Reputation: 171
I am trying to add values that are within two distinct cells to my combobox and I cant seem to get it to work! I know that I can populate a range of cells into my combo box:
Me.ComboBox3.List = Sheets("Sheet1").Range("C917:C927").Value
But how would I add c2, c4, c6
to a combobox?
Upvotes: 0
Views: 5309
Reputation: 912
Hi you need to use for each to loop trough the data and add items to the combo box
Dim c As Range
For Each c In Sheets("Sheet1").Range("C2,C4,C6")
Me.ComboBox3.AddItem c.Value
Next
To remove values use
For n = Me.ComboBox3.ListCount - 1 To 0 Step -1
Me.ComboBox3.RemoveItem n
Next n
Upvotes: 1