egoburnswell
New Member
- Joined
- Sep 2, 2015
- Messages
- 5
I have several global arrays of the form:
A1Array
A2Array
etc...
And I want to use a Combox dropdown to determine the contents of a second combobox.
So the first combobox is populated with:
A1
A2
etc...
I could use Case statements:
Select Case ComboBox1.Value
Case "A1"
For Each Item In A1Array
ComboBox2.AddItem Item
Next Item
Case "A2"
For Each Item In A2Array
ComboBox2.AddItem Item
Next Item
etc
End Select
But I have a lot of arrays, so this is messy.
I would like do something like
combobox2Array = ComboBox1.Value & "Array"
For Each Item In combobox2Array
ComboBox2.AddItem Item
Next Item
To iterate through the correct array, but this doesn't work.
Is there a way to do this, or a better way to achieve the end result?
Thanks.
A1Array
A2Array
etc...
And I want to use a Combox dropdown to determine the contents of a second combobox.
So the first combobox is populated with:
A1
A2
etc...
I could use Case statements:
Select Case ComboBox1.Value
Case "A1"
For Each Item In A1Array
ComboBox2.AddItem Item
Next Item
Case "A2"
For Each Item In A2Array
ComboBox2.AddItem Item
Next Item
etc
End Select
But I have a lot of arrays, so this is messy.
I would like do something like
combobox2Array = ComboBox1.Value & "Array"
For Each Item In combobox2Array
ComboBox2.AddItem Item
Next Item
To iterate through the correct array, but this doesn't work.
Is there a way to do this, or a better way to achieve the end result?
Thanks.