+ Reply to Thread
Results 1 to 5 of 5

Make lists in Combobox (userform) depend on each other

  1. #1
    Registered User
    Join Date
    01-12-2009
    Location
    Gothenburg, Sweden
    MS-Off Ver
    Excel 2003
    Posts
    15

    Make lists in Combobox (userform) depend on each other

    Hi,

    I have constructed a user form with a set of comboboxes containing a number of choices. However, the different alternatives depend on each other, and instead of having all the choices available in the second combobox I would like to only have the "correct" ones depending on the choice made in the earlier combobox.

    For example;
    ---------------
    A-B-C
    Car-Blue-USA
    Car-Red-USA
    Truck-Green-Sweden
    Truck-Blue-Sweden

    If I choose Car in the first combobox, I would like to only have the choices [Blue, Red] available in the second combobox, not the full set of data [Blue,Red,Green] and so on.

    However, I have two problems construction this;

    1) If I make the rowsource A1-A4 for the first combobox, I get the alternative [Car,Car,Truck,Truck], not [Car,Truck]. It is possible to come around this problem by making a unique list in addition to the linked list showed above, such as;

    A-B-C
    Car-Blue-Usa
    Truck-Red-Sweden
    -Green-

    2) To make the comboboxes depend on each other, and alternate the available choices according to the choice made in an earlier combobox.

    I have attached an example of a userform and list, and where I am at the moment.
    Combobox1-button, problem1 and problem 2
    Combobox2-button, only problem2
    Attached Files Attached Files
    Last edited by nalfin; 01-17-2009 at 07:24 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    It's hard to follow exactly what you want. Maybe this earlier example will help, it will need some slight adapting for your use
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-12-2009
    Location
    Gothenburg, Sweden
    MS-Off Ver
    Excel 2003
    Posts
    15
    Quote Originally Posted by royUK View Post
    It's hard to follow exactly what you want. Maybe this earlier example will help, it will need some slight adapting for your use
    Thank you for the reply Roy!

    The link seems to be wrong, it is referring me to a service for sending big files.

  4. #4
    Registered User
    Join Date
    01-12-2009
    Location
    Gothenburg, Sweden
    MS-Off Ver
    Excel 2003
    Posts
    15
    Sorry Roy with the above post, misinterpreted the link...

    Here's how I solved the problem
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ 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