I want to populate a combobox with contents from a row (not a column) of values from another sheet, using VBA. If I assign the List to the row's range I only see the 1st value, so I guess excel insists on having a column of ranges. So, I was trying something like adding items:
Private Sub ComboBox2_GotFocus()
Dim i As Integer
Dim myArray As Variant
myArray = Worksheets("data").Range("A4:PB4").Value
For i = LBound(myArray) To UBound(myArray)
Me.ComboBox2.AddItem myArray(i)
Next
End Sub
Two problems. I don't think that's an array, it's a range. And, if I use add, I need to clear it everytime, but somehow using ComboBox2.Clear in the same routine clears it even after it's loaded? So nothing shows up :(
Got any ideas?