Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
control arrays
I'm using VBA with Excel 5 and developing a form. Under VB6 I'd create a
control array to allow me to access 10 text boxes using a loop. VBA doesn't appear to allow this. Is there any way to simulate a control array eg by programatically modifying the names of the text boxes? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
control arrays
VBA do not allow control arrays. Instead you can consider one of the below
two approaches '------If the textboxes are named as TExtbox1,TExtbox2 ...Textbox10 Dim intCount as Integer For intCount = 1 To 10 Me.Controls("Textbox" & intCount).Text = intCount Next '-------If you are not sure of the textbox names you can try the below Dim Ctl As MSForms.Control For Each Ctl In UserForm1.Controls If TypeOf Ctl Is MSForms.TextBox Then ' do something MsgBox Ctl.Name End If Next -- Jacob "vb6user" wrote: I'm using VBA with Excel 5 and developing a form. Under VB6 I'd create a control array to allow me to access 10 text boxes using a loop. VBA doesn't appear to allow this. Is there any way to simulate a control array eg by programatically modifying the names of the text boxes? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
control arrays
You can emulate a control array with an event class, but unfortunately not
all of the events are exposed to this class. Which events are you after? --- HTH Bob Phillips "vb6user" wrote in message ... I'm using VBA with Excel 5 and developing a form. Under VB6 I'd create a control array to allow me to access 10 text boxes using a loop. VBA doesn't appear to allow this. Is there any way to simulate a control array eg by programatically modifying the names of the text boxes? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Control arrays on Excel 2007 userforms | Excel Discussion (Misc queries) | |||
Arrays - declaration, adding values to arrays and calculation | Excel Programming | |||
Control Arrays | Excel Programming | |||
Control Arrays? | Excel Programming | |||
On the lack of control arrays. | Excel Programming |