+ Reply to Thread
Results 1 to 5 of 5

Select Cases and Comboboxes

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Select Cases and Comboboxes

    Hello everyone. I have an outstanding problem that I could use some help on.

    I have a userform that contains two comboxes. If the user selects value "A" in the first combobox, I want a specified range in a spreadsheet to be used as the rowsource for the second combobox.

    If the user selects value "B" in the first combobox, I want a different specified range in a spreadsheet to be used as the rowsource for the second combobox.

    Below is the source code.

    Please Login or Register  to view this content.
    Now this code is in the actual userform itself. A seperate module "Module 3" shows the form :

    Please Login or Register  to view this content.
    it's not working, and I cannot figure it out. Any help is greatly appreciated.
    Last edited by AnthonyWB; 01-12-2011 at 08:28 PM.

  2. #2
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Re: Select Cases and Comboboxes

    Ok, it sort of works now with the following code:

    Please Login or Register  to view this content.
    The problem now is quite wierd. When the user selects a value in the first combobox, correct values are loaded into the second combobox however when you press the down arrow to display the values it comes up behind the other combobox.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Select Cases and Comboboxes

    Hi Anthony,

    I think you need to use
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    If that doesn't work try
    Please Login or Register  to view this content.
    See examples on http://www.ozgrid.com/VBA/select-case.htm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Select Cases and Comboboxes

    After searching the net for a long time it was easier to build a short example

    See attached.
    Attached Files Attached Files

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Select Cases and Comboboxes

    Here is the Case way to do this problem
    Please Login or Register  to view this content.
    Who would have guessed we needed "Case Is = " to make the syntax right.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1