+ Reply to Thread
Results 1 to 14 of 14

Multiple Options in Dependent Drop Down List Box

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Multiple Options in Dependent Drop Down List Box

    Hi There,

    Can anyone help me on how to add multiple options in dependent drop down and would be great if this can be done using a List Box (check box option). I am attaching a sample workbook, the user should be able to select multiple options in dropdown 3 and the values selected should be captured in the next tab "Data". And the list box should auto adjust the length as per the data available in the list.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Multiple Options in Dependent Drop Down List Box

    What depends on what? If I select County then it selects district. For the US are Central and North districts? Are Service and Repair services? What is Agri - is it a district or is it a service and is it available in both Central and north? How does selecting a District limit a service? Do I have both Service and Repair available whether I select North or Central (it doesn't matter)?

    You need a better defined hierarchy.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Multiple Options in Dependent Drop Down List Box

    Nevermind... misunderstood.
    Last edited by Arkadi; 04-18-2018 at 03:16 PM. Reason: Small typo, forgot an "_" in my list of Range Names
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Multiple Options in Dependent Drop Down List Box

    If you rename the service options in the District setup (because both UK and US have a North for example) then here is an option.

    I renamed the Service List Named Ranges, by Country then District with an underscore so US_Central, US_North, Canada_East, etc...

    Then Insert a ListBox form control, and in the worksheet module in VBA for Sheet1, I put this code:

    Please Login or Register  to view this content.
    Note that you will need to set the properties of the listbox to multiselect.

  5. #5
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Re: Multiple Options in Dependent Drop Down List Box

    Arkadi,

    Thanks for the help. I tried following your instructions about inserting the code but failed and I don't know how to link the list box to the code. I've amended the name ranges and removed the common values (service) in the sample sheet. Can you add your code to the sheet?
    Attached Files Attached Files

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059
    No problem, give me an hour or 2, then I will be at a computer.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Multiple Options in Dependent Drop Down List Box

    Ok so I removed Data Validation from Dropdown 3, since you wanted a listbox instead....
    Also ammended the code since you now have named ranges that match Dropdown 2 exactly... which is better. Note that it is not a listbox_click event, but a worksheet change event.
    The code doesn't have to be assigned to the listbox, since the macro runs when Dropdowns 1 or 2 change, not when the listbox changes or is clicked on.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Re: Multiple Options in Dependent Drop Down List Box

    Maybe I was unable to explain it better earlier, sorry for that. Dropdown 3 should be a multiple selection field. The user should be able to select multiple branches after selecting a district. You can have a look at the set up in "Data" tab, e.g District: Central_US has 3 branches (Central_1, Central_2 and Central_3).

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Multiple Options in Dependent Drop Down List Box

    Sorry, forgot about that....
    Right-click on the listbox, select format control, then under the "Control" tab, change Single to Multi.

  10. #10
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Re: Multiple Options in Dependent Drop Down List Box

    I did that. What I required is below and not to select the districts (see the attached picture.

    Dropdown 3 should be a multiple selection field. The user should be able to select multiple branches after selecting a district. You can have a look at the set up in "Data" tab, e.g District: Central_US has 3 branches (Central_1, Central_2 and Central_3).

    Please help..
    Attached Images Attached Images

  11. #11
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Multiple Options in Dependent Drop Down List Box

    Oh wow I'm such a dummy.... Go to VBA editor (Alt-F11), Double-Click on "Sheet1(Sheet1)", find this line of code:

    Please Login or Register  to view this content.
    And change D2 to D3:

    Please Login or Register  to view this content.
    Sorry about that!

  12. #12
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Re: Multiple Options in Dependent Drop Down List Box

    Perfect... It is working!! Need last few tweaks to get there.

    1. Can the dropdown be rolled back to the first option (Select District, Select Branch) when "Select Country" is selected in the first selection?
    2. Can the selected values in dropdown 3 be entered in the next cell/cells i.e. E4, F4, G4 & so on?
    3. Just wondering if it is possible to make it a checkbox type selection rather than a mouse click?

  13. #13
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Multiple Options in Dependent Drop Down List Box

    Does this behave as expected? Once it is fine-tuned I'll look at placing values from the ListBox (not dropdown). To enable checkboxes I had to change from Form Control to ActiveX Control so the code is quite different.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    07-18-2021
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    11

    Re: Multiple Options in Dependent Drop Down List Box

    Hi. I have a similar problem I need help with. I don't really understand VBA so I haven't been able to adjust the code above to do what I want. I want to be able to select multiple options in a dependent drop down. I want each option selected to remain in the same cell but on a different line. So for example, my parent cell says Body (what area of the body). If for example, I select Neck, then I have a drop down with several options but I may want to select SCM and scalenes and erectors. I will attach my workbook (it has no data in it yet) and on one sheet I will show what I want the end result to look like as well as highlighted the relevant columns where the data will appear on my Month tab.
    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)

Similar Threads

  1. Replies: 1
    Last Post: 11-27-2017, 02:31 PM
  2. Select multiple options from drop down list
    By forestview in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-26-2016, 01:42 PM
  3. Select multiple options from drop down list
    By nsprasad in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-29-2015, 05:30 AM
  4. [SOLVED] Printing Multiple Options from a Drop-Down List
    By JayPear in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2014, 10:07 PM
  5. multiple Dependent drop down list with default value
    By Dansolo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-12-2014, 01:27 PM
  6. Replies: 0
    Last Post: 03-17-2014, 02:11 PM
  7. [SOLVED] Column B drop down list with 2 options, columns C & E with dependent drop down lists
    By betic in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-26-2012, 03:47 PM

Tags for this Thread

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