Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Building object reference
Hi Experts,
My question is, how can I refer to objects(eg. textboxes) in a for..next cycle, for instance something like this: for i=1 to 10 (textbox & i).text=Cstr(i) 'where (textbox & i) is for representing 'textbox1...textbox10 next i Thanks in advance: Zsola |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Building object reference
textboxes from the control toolbox toolbar
on a userform for i = 1 to 10 userform1.Controls("Textbox" & i).Text = "" Next on a Worksheet for i = 1 to 10 activesheet.OleObjects("TextBox" & i).Object.Text = "" Next Textboxes from the drawing toolbar for i = 1 to 10 Activesheet.Textboxes("Textbox" & i).Value = "" Next -- Regards, Tom Ogilvy "zsola" wrote in message ... Hi Experts, My question is, how can I refer to objects(eg. textboxes) in a for..next cycle, for instance something like this: for i=1 to 10 (textbox & i).text=Cstr(i) 'where (textbox & i) is for representing 'textbox1...textbox10 next i Thanks in advance: Zsola |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Building object reference
For i = 1 to 10
Me.Controls("TextBox" & i).Text = i Next i -- HTH RP (remove nothere from the email address if mailing direct) "zsola" wrote in message ... Hi Experts, My question is, how can I refer to objects(eg. textboxes) in a for..next cycle, for instance something like this: for i=1 to 10 (textbox & i).text=Cstr(i) 'where (textbox & i) is for representing 'textbox1...textbox10 next i Thanks in advance: Zsola |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Building object reference
Thanks. this is the solution.
-----Original Message----- textboxes from the control toolbox toolbar on a userform for i = 1 to 10 userform1.Controls("Textbox" & i).Text = "" Next on a Worksheet for i = 1 to 10 activesheet.OleObjects("TextBox" & i).Object.Text = "" Next Textboxes from the drawing toolbar for i = 1 to 10 Activesheet.Textboxes("Textbox" & i).Value = "" Next -- Regards, Tom Ogilvy "zsola" wrote in message ... Hi Experts, My question is, how can I refer to objects(eg. textboxes) in a for..next cycle, for instance something like this: for i=1 to 10 (textbox & i).text=Cstr(i) 'where (textbox & i) is for representing 'textbox1...textbox10 next i Thanks in advance: Zsola . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reference(s) to worksheets for building graphs | Excel Worksheet Functions | |||
Building a reference by concatenating components | Excel Discussion (Misc queries) | |||
any good reference books on building excel formulas? | Excel Worksheet Functions | |||
How do I add a reference to an object library using VBA? | Excel Programming | |||
web page object reference | Excel Programming |