S
Stacy
I have a number of ComboBoxes on a Userform that all do the same
thing. I would like to be able to do all the init stuff in a For loop.
How can I refer to the ComboBoxes without specificing each name. The
following would be great but, of course it doesn't work. Any ideas?
ComboBoxArray = Array("ComboBox1", "ComboBox2", "ComboBox3",
"ComboBox4", "ComboBox5")
For i = 1 To NumComboBoxes
With HeaderUserForm.ComboBoxArray(i)
.Clear ' clear the listbox content
.ListIndex = 0 ' select the first item
' Do the other stuff
End With
Next i
thing. I would like to be able to do all the init stuff in a For loop.
How can I refer to the ComboBoxes without specificing each name. The
following would be great but, of course it doesn't work. Any ideas?
ComboBoxArray = Array("ComboBox1", "ComboBox2", "ComboBox3",
"ComboBox4", "ComboBox5")
For i = 1 To NumComboBoxes
With HeaderUserForm.ComboBoxArray(i)
.Clear ' clear the listbox content
.ListIndex = 0 ' select the first item
' Do the other stuff
End With
Next i