Thread: VBA Combo Box
View Single Post
  #1   Report Post  
Jeff
 
Posts: n/a
Default VBA Combo Box

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.