Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

program next column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChuckS - 27 Mar 2008 01:57 GMT
Hello,
I have a couple of user forms including text boxes that I would like to use
to complete cells in a spreadsheet. I need to look for the next empty cell to
start the data in column a. I have this code working fine but is there a
simple way to increment the c.address by one column marker to shift from a to
b, b to c and so on.
Barb Reinhardt - 27 Mar 2008 02:11 GMT
Lets say c.address = C1

c.offset(0,1).address = D1
c.offset(0,2).address = E1

Make sense?
Signature

HTH,
Barb Reinhardt

> Hello,
> I have a couple of user forms including text boxes that I would like to use
> to complete cells in a spreadsheet. I need to look for the next empty cell to
> start the data in column a. I have this code working fine but is there a
> simple way to increment the c.address by one column marker to shift from a to
> b, b to c and so on.
ChuckS - 27 Mar 2008 02:58 GMT
Barb,
Thank you I knew I had done this before but I was going brain dead, it works
perfectly as you suggested
c.offset(0,1).value = Textbox2.value

Chuck

> Lets say c.address = C1
>
[quoted text clipped - 9 lines]
> > simple way to increment the c.address by one column marker to shift from a to
> > b, b to c and so on.
Dave Peterson - 27 Mar 2008 02:26 GMT
I use this kind of thing:

Dim NextCell as range
with worksheets("somesheetnamehere")
  set Nextcell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with
with nextcell
  .value = "stuff in column A"
  .offset(0,1).value = "stuff in B"
  .offset(0,2).value = "stuff in C"
end with

=====
Sometimes, I use:
Dim NextRow as long
with worksheets("somesheetnamehere")
  NextRow = .cells(.rows.count,"A").end(xlup).row + 1
  .cells(nextrow,"A").value = "a"
  .cells(nextrow,"B").value = "B"
  .cells(nextrow,"C").value = "C"
end with

> Hello,
> I have a couple of user forms including text boxes that I would like to use
> to complete cells in a spreadsheet. I need to look for the next empty cell to
> start the data in column a. I have this code working fine but is there a
> simple way to increment the c.address by one column marker to shift from a to
> b, b to c and so on.

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.