+ Reply to Thread
Results 1 to 5 of 5

Userform with two combobox dependent on one combobox

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    21

    Userform with two combobox dependent on one combobox

    Hi,

    I have looked all over the place to try and find an answer to this problem:

    I have a userform that has several combobox's linked to named ranges. What I need to do is pick a value from combobox 1 and then allow combobox 2 & combobox 3 to have independent choices of named ranges dependent on only combobox 1.

    I can do this very easily on an excel spread sheet using data validation and having the 3rd combobox validate with =INDIRECT(SUBSTITUTE(B5&"_Alt"," ","")), where the _Alt is given to the 3 set of named ranges as an appendment.

    THis is the code I am using for the listbox, but the same applies to a combobox:
    Please Login or Register  to view this content.
    I want this on a userform so I can control the underlying database.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Userform with two combobox dependent on one combobox

    Try something like this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 06-10-2012 at 09:40 AM.

  3. #3
    Registered User
    Join Date
    05-09-2012
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Userform with two combobox dependent on one combobox

    Tried that and didn't work, I have attached the spread sheet.

    You will see on the MASTER tab a button to create modules that brings up the userform the second and sixth combobox's work from the first.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Userform with two combobox dependent on one combobox

    There are spaces in the items in the combobox and no spaces for the corresponding named range.

    This removes the spaces from the selected combobox item.

    Please Login or Register  to view this content.
    There are also items in the combobox that do not have a named range. I don't know what you want to do in those cases.

  5. #5
    Registered User
    Join Date
    05-09-2012
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    21

    Re: Userform with two combobox dependent on one combobox

    Excellent that did the trick, simple when you know how, I just had to change one little bit of the first P1ComboBox.List, and that was to remove the & "_Alt".

    Thank you very much for your help

+ 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