Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox values used in macros
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox values used in macros
If the code is under that userform:
dim myStr as string mystr = me.combobox1.value select case lcase(mystr) case is = "january" 'do something case is = ..... PaulaO wrote: 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. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill values into a listbox matching selected values from a combobox | Excel Programming | |||
ComboBox Values | Excel Programming | |||
Assigning Multiple Macros to One ComboBox Control | Excel Programming | |||
Assigning Multiple Macros to One ComboBox Control | Excel Programming | |||
ComboBox Values | Excel Programming |