Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
User form JonathanW Excel Discussion (Misc queries) 1 May 2nd 07 07:50 AM
User form Mike Rogers Excel Discussion (Misc queries) 2 March 10th 06 05:56 PM
user form hngo New Users to Excel 2 July 13th 05 11:48 PM
User Form Still Trying mully New Users to Excel 3 May 26th 05 06:30 PM


All times are GMT +1. The time now is 07:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"