UserForm1.ComboBox1 to initialize

P

Philosophaie

In "View Code" of Userform1 I can not get UserForm1.ComboBox1 to initialize:
item1
item2
when I show the userform.

Private Sub CommandButton1_Click()
With UserForm1.ComboBox1
.AddItem "item1"
.AddItem "item2"
End With
..
Userform program
..
 
J

JLGWhiz

The initialize event occurs with the UserForm, not the ComboBox.

Private Sub UserForm_Initialize()
With Me.ComboBox1
.AddItem "item1"
.AddItem "item2"
End With
End Sub

The ComboBox should then display the two items as options in the drop down.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top