View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default Text Box Question

I have several text boxes on a worksheet that I'd like to loop through
and collect the input.

my_info=activesheet.textbox1

collects the information in textbox1. The following loop successfully
collects the data from all 6 text boxes.

n = 0 ' array is option base 0
For x = 1 To 6
my_info = ActiveSheet.OLEObjects("TextBox" & x).Object
ReDim Preserve retire_array(n)
info_array(n) = yy
n = n + 1
Next

My question is, is there a more concise construction then "my_info =
ActiveSheet.OLEObjects("TextBox" & x).Object" that I could use? I've
tried things like

my_info = activesheet.textbox(x)
my_info = activesheet.textboxes(x).text
my_info = activesheet.textboxes(x)
my_info = activesheet.textboxes(x).text

but none of these work. Is there some short construct other than the
one above using the Objects.object approach that will work?..TIA, Ron