Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA User form
Hello,
I have a Combo Box in a form. Based on user input I wish to perform different actions, unfortunately it is not going so well. on the click of a button I have: UserForm2.Show then I initiatlize the Combo Box pul down entires: Private Sub UserForm_Initialize() ComboBox1.AddItem "" ComboBox1.AddItem "Y1-Qrtr1" ComboBox1.AddItem "Y1-Qrtr2" ComboBox1.Style = fmStyleDropDownList ComboBox1.BoundColumn = 0 ComboBox1.ListIndex = 0 End Sub then I have a piece of code that performs a select case based on the selection in the Combo Box: Private Sub ComboBox1_Click() Select Case ComboBox1.Value Case 1 '"Y1-Qrtr1" 'DO ONE THING Me.Hide Case 2 '"Y1-Qrtr2" 'SO ANOTHER THING Me.Hide End Select End Sub For some reason the Combo Box runs thru with out showing on the screen... since some of my activies need input I get an error down stream Please response. Thanks in anticipation, -Neil |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA User form
Neil,
You need to initialize the userform before showing it, or repaint it after showing and initializing the combo box. HTH, Greg "Neil Bhandar" wrote in message ... Hello, I have a Combo Box in a form. Based on user input I wish to perform different actions, unfortunately it is not going so well. on the click of a button I have: UserForm2.Show then I initiatlize the Combo Box pul down entires: Private Sub UserForm_Initialize() ComboBox1.AddItem "" ComboBox1.AddItem "Y1-Qrtr1" ComboBox1.AddItem "Y1-Qrtr2" ComboBox1.Style = fmStyleDropDownList ComboBox1.BoundColumn = 0 ComboBox1.ListIndex = 0 End Sub then I have a piece of code that performs a select case based on the selection in the Combo Box: Private Sub ComboBox1_Click() Select Case ComboBox1.Value Case 1 '"Y1-Qrtr1" 'DO ONE THING Me.Hide Case 2 '"Y1-Qrtr2" 'SO ANOTHER THING Me.Hide End Select End Sub For some reason the Combo Box runs thru with out showing on the screen... since some of my activies need input I get an error down stream Please response. Thanks in anticipation, -Neil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
User form | Excel Discussion (Misc queries) | |||
User form | Excel Discussion (Misc queries) | |||
user form | New Users to Excel | |||
User Form Still Trying | New Users to Excel |