I'm trying to create a Userform in Excel, where I have one ComboBox and based on the value chosen, values from a range of cells are to be shown in a listbox on the Userform.
So far I have this.
Private Sub UserForm_Initialize()
With ComboBox1()
.AddItem "Item1"
.AddItem "Item2"
.AddItem "Item3"
.AddItem "Item4"
.AddItem "Item5"
.AddItem "Item6"
.AddItem "Item7"
End With
End Sub
Sub ComboBox1_Change()
If ComboBox1.ListIndex = Outlook Then
Range("A3:B11").Show
Else
If ComboBox1.ListIndex = NoNetwork Then
Range("C3:D11").Show
End If
End If
End Sub
If I change Range("A3:B11").Show
to Range("A3:B11").Select
it will select this range.
How do I instead show the data from this range on the UserForm?
.AddItem CellValue
– Sorceri