Hey there,
I am trying to create a code where I can do do the following With command for a ComboBox where it uses a variable to change the ComboBox name.
Currently it is:
With Sheet1.ComboBox1
.AddItem Sheet1.Range("B" & i).Value
End With
But I would like it to be something like
Dim Variable
Variable = 1
With Sheet1."ComboBox" & Variable
.AddItem Sheet1.Range("B" & i).Value
End With
Is there a way to easily do this?
Thanks so much in advance for your help!
I am trying to create a code where I can do do the following With command for a ComboBox where it uses a variable to change the ComboBox name.
Currently it is:
With Sheet1.ComboBox1
.AddItem Sheet1.Range("B" & i).Value
End With
But I would like it to be something like
Dim Variable
Variable = 1
With Sheet1."ComboBox" & Variable
.AddItem Sheet1.Range("B" & i).Value
End With
Is there a way to easily do this?
Thanks so much in advance for your help!