Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default program next column

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default program next column

Lets say c.address = C1

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

Make sense?
--
HTH,
Barb Reinhardt



"ChuckS" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default program next column

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

ChuckS wrote:

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.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default program next column

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

"Barb Reinhardt" wrote:

Lets say c.address = C1

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

Make sense?
--
HTH,
Barb Reinhardt



"ChuckS" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
how do i program excel to insert a new column monthly jo Excel Programming 0 April 6th 06 10:19 AM
Need to program a find only in one column xrckiss Excel Programming 2 April 1st 06 05:34 AM
Program Column B to record numerical range based on number in colm Nikole Excel Discussion (Misc queries) 2 August 17th 05 08:37 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM


All times are GMT +1. The time now is 04:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"