ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UserForm1.ComboBox1 to initialize (https://www.excelbanter.com/excel-programming/442642-userform1-combobox1-initialize.html)

Philosophaie

UserForm1.ComboBox1 to initialize
 
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
..


JLGWhiz[_2_]

UserForm1.ComboBox1 to initialize
 
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.

"Philosophaie" wrote in message
...
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
.





All times are GMT +1. The time now is 08:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com