G
Guest
I have a combo box that I want to populate with a list of names.
I do not want to reference names in the worksheet - using "RowSource" - I
want to write the names in the code.
I tried the following code:
Private Sub ComboBox1_Change()
With ComboBox1
..RowSource = ""
..AddItem "Male"
..AddItem = "Female"
End With
End Sub
This gives me an error. Does anyone know where the code should be added.
I do not want to reference names in the worksheet - using "RowSource" - I
want to write the names in the code.
I tried the following code:
Private Sub ComboBox1_Change()
With ComboBox1
..RowSource = ""
..AddItem "Male"
..AddItem = "Female"
End With
End Sub
This gives me an error. Does anyone know where the code should be added.