View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Combobox values used in macros

Something like...

Sub DependingOnTheMonth()
Dim strMonth As String
Dim strResult As String
strMonth = UserForm2.ComboBox1.Value

Select Case strMonth
Case "January"
strResult = "Shovel Snow"
Case "February"
strResult = "Go on Vacation"
'march thru december
Case Else
End Select
End Sub
'--------------

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"PaulaO"
wrote in message
...
I need to get the value selected in a combobox from a userform to be the
subject of a select case statement.

For example, in Userform2, the combobox is going to select a month, then I
want the selection to become the value of a variable in a select case
statement in a macro. I am not sure how to get the selected value to flow
through.

Any assistance would be appreciated.