PDA

View Full Version : [SLEEPER:] Drop down list help needed. Want lists that only shows selections from another list.



Rob5060
08-22-2024, 07:18 AM
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!

georgiboy
08-22-2024, 07:34 AM
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.

Rob5060
08-22-2024, 08:06 AM
Sorry, meant to include the version. It's 365. I've attached the spreadsheet with the code I found and was trying out.

jdelano
08-23-2024, 02:54 AM
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.

Rob5060
08-26-2024, 12:12 PM
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.

jdelano
08-26-2024, 01:40 PM
Sure thing. Here you go.

Rob5060
08-29-2024, 08:14 AM
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.

Aussiebear
08-29-2024, 02:07 PM
Then perhaps Excel is the wrong software to be using.

Paul_Hossler
08-29-2024, 03:12 PM
When i select Main Emp or RTR Emp I get an empty dropdown and nothing happens

Rob5060
08-29-2024, 04:36 PM
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.