LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
theguz
 
Posts: n/a
Default Which loop to use


Here is my question. I have a user form with 12 textboxes, each named
textbox1-textbox12. I want the data to go from the user form to a
sheet. I try to make the process quicker by using a for loop. For
example:

For k=1 to 12
j=k+1
ActiveCell.Offset(k,0).Value = TextBoxj.value 'Here is where error
is highlighted
Next k

However, everytime I try this I get the same error saying "Object
required". The only way I can get this to work is by individualy
giving the value of the cell the value of the textbox, for example:
ActiveCell.Offset(1,0).Value = TextBox2.value 'I do this for all 12
textboxes.

Is there a way to loop this so I don't have to right each line of code?
Thanks for your help in advance.

theguz


--
theguz
------------------------------------------------------------------------
theguz's Profile: http://www.excelforum.com/member.php...o&userid=24918
View this thread: http://www.excelforum.com/showthread...hreadid=393366

 
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
Proper Do Loop Construction ChasX Excel Discussion (Misc queries) 6 July 1st 05 10:38 PM
Next w/o For If/Then Loop littlegreenmen1 Excel Discussion (Misc queries) 5 June 9th 05 05:28 PM
VB for excel, how do I loop through code steve hobden via OfficeKB.com Excel Discussion (Misc queries) 2 June 9th 05 01:59 PM
loop trough e-mail address list to send task lists with outlook Paul. Excel Discussion (Misc queries) 2 April 14th 05 11:48 AM
Printe Autofilter Criterias in a Loop Paul. Excel Discussion (Misc queries) 1 March 25th 05 12:51 PM


All times are GMT +1. The time now is 08:12 PM.

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

About Us

"It's about Microsoft Excel"