Array question

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

In VB, when you copy a control or give two controls the
same name, VB asks if you want to create an array, and
creates the name with a subscript, such as Textbox(1),
Textbox(2), etc. It appears that VBA does not do this.
I'm not sure how to declare an array here.

I have five dropdown combo boxes that I want to each fill
with the same five values, and it seemed most efficient to
do this with an array.
 
VBA doesn't support control arrays.

for i = 1 to 5
userform1.Controls("Combobox" & i).List = Array(1,2,3,4,5)
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top