Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Using a DO loop to add values into a textbox

I have a series of textboxes in a form and want to enter the values from an
array into each of the textboxes.

Is there any way to do this using a DO loop rather than having to write out
each textbox one by one

something like

co1 = 0
Do
co1 = co1 + 1
userform1.textbox(co1) = varray(co1)
if co1 = 100 then exit do
Loop

rather than

userform1.textbox1 = varray(1)
userform2.textbox2 = varray(2)
etc
etc

Ian B

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Using a DO loop to add values into a textbox

If you name them nicely, maybe...

col = 0
Do
co1 = co1 + 1
userform1.controls("textbox" & co1) = varray(co1)
if co1 = 100 then exit do
Loop

You really have 100 textboxes on your form?


Ian B wrote:

I have a series of textboxes in a form and want to enter the values from an
array into each of the textboxes.

Is there any way to do this using a DO loop rather than having to write out
each textbox one by one

something like

co1 = 0
Do
co1 = co1 + 1
userform1.textbox(co1) = varray(co1)
if co1 = 100 then exit do
Loop

rather than

userform1.textbox1 = varray(1)
userform2.textbox2 = varray(2)
etc
etc

Ian B


--

Dave Peterson
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
Textbox values browie Excel Programming 3 June 20th 05 02:52 PM
How do I add TextBox.values? WTG Excel Programming 4 February 28th 05 09:38 AM
How do I add TextBox.values? WTG Excel Discussion (Misc queries) 1 February 27th 05 08:25 PM
How do I add TextBox.values? WTG Excel Worksheet Functions 1 February 27th 05 08:22 PM
loop in a textbox libby Excel Programming 1 August 3rd 04 11:30 PM


All times are GMT +1. The time now is 05:14 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"