+ Reply to Thread
Results 1 to 5 of 5

combobox populated based off of other value

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-12-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    163

    combobox populated based off of other value

    im creating a userform and i have two catagories that i have pull down lists for. the first one are catagories like Auto & Transport, Entertainment, Food and Dining, ect. I can populate that list but the next list will be based off of what catagory i choose in the first list. Say if I choose Food and Dining. then the next drop down box i want the options Fast Food, Groceries, Restaurants, Coffe Shops, Alcohol & Beer, and other to be populated. and if another option is choosen then i want different lists to populate in that dropdown box.

    If someone can give me the general way of doing or any help or direction with this i can play around with it

    thank you
    jed38

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: combobox populated based off of other value

    You something like this in your Userform Module.
    Change the Range Addresss to suit you Lists
    Private Sub UserForm_Initialize()
    With ComboBox1
    .List = Array("Auto", "Transport", "Entertainment", "Food and Dining")
    .ListIndex = 0
     End With
    End Sub
    
    Private Sub ComboBox1_Change()
    Select Case ComboBox1.Value
        Case Is = "Auto": ComboBox2.List = Range("A1:A10").Value
        Case Is = "Transport": ComboBox2.List = Range("B1:B10").Value
        Case Is = "Entertainment": ComboBox2.List = Range("C1:C10").Value
        Case Is = "Food and Dining": ComboBox2.List = Range("D1:D10").Value
    End Select
    ComboBox2.ListIndex = 0
    End Sub

  3. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: combobox populated based off of other value

    Excel VBA: Dependent Lists for Combobox Controls

    Many more links here; VBA dependent comboboxes
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: combobox populated based off of other value

    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  5. #5
    Forum Contributor
    Join Date
    08-12-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: combobox populated based off of other value

    thanks ill have to look into the links and MickG that code was just what i needed

    thanks everyone

+ 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