Reputation: 187
I'm populating a VBA ComboBox with some data from a Workshet. As it is populated depending on the choice of the user, sometimes some levels are should not be populated, because they do not have data. When such a thing happens, I want to populate the items of a ComboBox with the same of another. How can a do that?
I think if somebody teaches me how to loop through the items of a ComboBox, I will the able to do what I want.
Upvotes: 1
Views: 48
Reputation: 6761
Here is how you loop through a combobox.
Dim intComboItem As Integer
For intComboItem = 0 To Me.ComboBox1.ListCount - 1
MsgBox Me.ComboBox1.List(intComboItem)
Next
Upvotes: 1