Consulting

Results 1 to 10 of 10

Thread: Drop down list help needed. Want lists that only shows selections from another list.

  1. #1
    VBAX Regular
    Joined
    Dec 2023
    Posts
    12
    Location

    Drop down list help needed. Want lists that only shows selections from another list.

    I'm not sure if what I'm attempting to do is even possible, but if it is I'm hoping someone can help or at least give some suggestions on how to accomplish what I'm trying to do.

    I am working on a spreadsheet to help us at work to keep track of incident reports. I have a drop down list with all of our employees names that I would like to be able to select multiple names from that would then appear in that same cell.

    I have found code that allows me to select multiple names that will appear in that cell and would work fine. What I would like to do next, that I haven't found anything on, is that for whatever names I select they then appear in another drop down list in a different cell.

    For example: I have F1 labeled "Involved Employees". In the drop down list for cell F2, I select employees A, B, C, and D. "A, B, C, D" then shows in cell F2. Cell N1 is labeled "Reports Needed" and O1 is "Reports Done". I would like a drop down list in each of those cells that only lists the employees I originally selected in cell F2 (A, B, C, D). It would be even better if when a name is selected in O1 that it removes that same name from N1.

    Hopefully that makes sense. I've looked around multiple places and watched numerous videos but have not had any luck finding anything that is along the same lines of what I'm trying to accomplish. I'm open to any method(s) other than drop down lists that might work to accomplish this.

    Thank you in advance for your help!

  2. #2
    Administrator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,254
    Location
    Are you able to provide the spreadsheet (private info removed) with the code you mention implemented?

    Might also be beneficial to mention which version of Excel you are using: 365, 2016 etc.
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2408, Build 17928.20080

  3. #3
    VBAX Regular
    Joined
    Dec 2023
    Posts
    12
    Location
    Sorry, meant to include the version. It's 365. I've attached the spreadsheet with the code I found and was trying out.
    Attached Files Attached Files

  4. #4
    You could do something like, add an activex combobox (changed to be a dropdown list in the style property) to N1, then this code to the worksheet change event (EDIT: right before the application.enablesevents = True line)
            ' update the reports or supps needed dropdown list
            Dim emp As Variant
            drpSelectedEmployees.Clear
            For Each emp In Split(Destination.Value, ",")
                drpSelectedEmployees.AddItem emp
            
            Next emp
    You'll need to work out changes after the fact, you can add code to the O column to remove from N on Click of another combobox in the O column.
    I guess the list in O will operate like that of F.
    Attached Images Attached Images

  5. #5
    VBAX Regular
    Joined
    Dec 2023
    Posts
    12
    Location
    Are you able to post the sheet with your code working like in the screen shot? I've added your code and I can't seem to get it working. I've also updated the code on the sheet with code I found to limit the multi-select to just the one column instead of the entire sheet. I've attached the spreadsheet with the new code.
    Attached Files Attached Files

  6. #6
    Sure thing. Here you go.
    Attached Files Attached Files

  7. #7
    VBAX Regular
    Joined
    Dec 2023
    Posts
    12
    Location
    Quote Originally Posted by jdelano View Post
    Sure thing. Here you go.
    Thank you for posting that! I made some changes to the sheet to simplify it a bit more and how it is now I believe will work just fine for what we need.

    The only thing I'm trying to figure out now is how to make each row the same. If I add another drop down for Involved Employees along with more combo boxes and a list box so that it functions how the first row does without the boxes interacting with each other.

    I'm sure this is a simple fix that I'm just not thinking about. But if I add another multi-select drop down in the next row with combo and list boxes, the combo and list boxes in both rows are affected by the drop-down lists in both rows. Each row will be separate information and the selections from each row's drop-down lists should only affect the combo and list boxes for that row.

    I've attached the current sheet with the changes I've made and the first row functioning how I'd like. The Involved Employees column is a multi-select list, and the selections will then appear in the drop-down combo boxes in the next two columns for the user to select one option in each. Then in the last column, all the selected options from the first list appear with check boxes for the user to check off on as reports are completed.
    Attached Files Attached Files

  8. #8
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,217
    Location
    Then perhaps Excel is the wrong software to be using.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  9. #9
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,771
    Location
    When i select Main Emp or RTR Emp I get an empty dropdown and nothing happens
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  10. #10
    VBAX Regular
    Joined
    Dec 2023
    Posts
    12
    Location
    Quote Originally Posted by Paul_Hossler View Post
    When i select Main Emp or RTR Emp I get an empty dropdown and nothing happens
    The column before both of those, involved employees, has a multi-select drop down list in it. Once you select any number of employees in that list the combo boxes for Main Emp and RTR Emp should show all the employees you previously selected, and allow you to select one of them.

Posting Permissions

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