excelenergy
Board Regular
- Joined
- Jun 7, 2012
- Messages
- 142
Hello
I have a command button, located on my spreadsheet. The code for the command button is in the vba editor within the name of the sheet - which is sheet114.
When the command button is clicked, a userform pops up. The userform has combo-boxes on it.
The userform is failing to initialize, and populate the combox boxes. Here is the code for the user-form initialize sequence and the drop downs, I was curious why isn't it initializing and populating? It should be, I'm not getting any kind of errors from VBE.
Code for the Command Button:
Code for Initialization of the Form:
This is the code for combo-box1:
I have a command button, located on my spreadsheet. The code for the command button is in the vba editor within the name of the sheet - which is sheet114.
When the command button is clicked, a userform pops up. The userform has combo-boxes on it.
The userform is failing to initialize, and populate the combox boxes. Here is the code for the user-form initialize sequence and the drop downs, I was curious why isn't it initializing and populating? It should be, I'm not getting any kind of errors from VBE.
Code for the Command Button:
Code:
Private Sub CommandButton1_Click()
UserForm1.Show
End Sub
Code for Initialization of the Form:
Code:
Private Sub UserForm1_Initialize()
With ComboBox1
.AddItem "Telephones"
.AddItem "Computers"
.AddItem "Monitors"
End With
End Sub
This is the code for combo-box1:
Code:
Private Sub ComboBox1_Change()
Dim index As Interger
index = ComboBox1.ListIndexComboBox2.Clear
Select Case index
Case Is = 0
With ComboBox2
.AddItem "CISCO
.AddItem "Bell"
.AddItem "Oracle"
End With
Case Is = 1
With ComboBox2
.AddItem "Sony"
.AddItem "Hewlet Packard"
.AddItem "Dell"
End With
Case Is = 2
With ComboBox2
.AddItem "Acer"
.AddItem "Dell"
.AddItem "Samsung"
End With
End Select
End Sub