B
Brian
I have a combobox from which, when the user selects an item, I want it to
find the data within a range, and use it to populate a ListBox. For the life
of me, I can't seem to figure it out. Any thoughts would be appreciated as
this is my first attempt at using Excel VBA. The code I have so far is:
(there is more than one case statement, but one should suffice for pointers.)
Private Sub ComboBox1_click()
Dim refrange As Range
Select Case ComboBox1.Value
Case "GSOP_286"
Set refrange = Sheets("Data").Range("A3:A20").Value.Select
For Each c In refrange
ListBox1.AddItem c.Value
Next
End Select
End Sub
Thanks,
find the data within a range, and use it to populate a ListBox. For the life
of me, I can't seem to figure it out. Any thoughts would be appreciated as
this is my first attempt at using Excel VBA. The code I have so far is:
(there is more than one case statement, but one should suffice for pointers.)
Private Sub ComboBox1_click()
Dim refrange As Range
Select Case ComboBox1.Value
Case "GSOP_286"
Set refrange = Sheets("Data").Range("A3:A20").Value.Select
For Each c In refrange
ListBox1.AddItem c.Value
Next
End Select
End Sub
Thanks,