Re: Combobox values used in macros

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • RE: Data table function - A dropdown list replacement for VLookup.
    ... To do this you would be well served by a UserForm which we will create now. ... This will create a ComboBox control on the form. ... “Typing in the selection box will bring matching choices, ... The above code that we just pasted into the code window will take the data ...
    (microsoft.public.excel.worksheet.functions)
  • RE: Data table function - A dropdown list replacement for VLookup.
    ... To do this you would be well served by a UserForm which we will create now. ... This will create a ComboBox control on the form. ... “Typing in the selection box will bring matching choices, ... Private Sub Clear_Form_Click ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Input box based upon a list
    ... information that is to be loaded into the combobox will not change, ... On the UserForm, have a list box and a Command Button ... ' Open the file containing the client details ... How do I populate the combo box with info for selection ...
    (microsoft.public.word.vba.userforms)
  • Re: How can I delete row from userform?
    ... How did the product names get in the combobox. ... Are you droping the userform as soon as the selection is made, ... > I have userform with one combox which contains products name from sheet 1 ...
    (microsoft.public.excel.programming)
  • RE: Macro to load userform from combobox
    ... > I'm using a combobox from the forms toolbar which, when a selection is made, ... > should load a userform. ... > load the form and in "on exit" of the properties of the combobox I've put the ... However, the userform doesn't load. ...
    (microsoft.public.word.vba.general)