Hi,
Im trying to populate a combo first time coding but no luck. Any ideas how its done. Below is my code. Thanks
Private Sub cmb_Change()
cmb.ListIndex = 0
cmb.AddItem ("Yellow")
cmb.AddItem ("Pink")
cmb.AddItem ("Blue")
cmb.ListIndex = -1
End Sub
Printable View
Hi,
Im trying to populate a combo first time coding but no luck. Any ideas how its done. Below is my code. Thanks
Private Sub cmb_Change()
cmb.ListIndex = 0
cmb.AddItem ("Yellow")
cmb.AddItem ("Pink")
cmb.AddItem ("Blue")
cmb.ListIndex = -1
End Sub
You shouldn't add the items in the change event of the combo box, you should do it in the form load event. The change event is fired when you type something in the textbox part of the combo box.
Which Office program is this in? Is it in a UserForm or ???
If a UserForm then you could use the Initialize event of the Form to load all the combo's items.
I am putting the control in a PowerPoint slide and I dont know the object to call and which method on slide load. Can you help please
bump