Link to home
Start Free TrialLog in
Avatar of -Polak
-PolakFlag for United States of America

asked on

Cascading Drop Down... Excel Combo Boxes

Hi Experts,

This is a follow up to this question: https://www.experts-exchange.com/questions/26451367/Cascading-Drop-Down-Menus-In-Excel-for-a-Tracker.html

Background, I have a need to create drop down menus using a Form Controls Combo Box rather than a cell with data validation. The reason for this is because I would like to keep the items selected in the combo box drop down in a UI across the top of ALL worksheets. As such, I will use combo boxes and then create Indirects for the "link cell" resulting from a combo box selection to point dependent cells to. As I'm unfamiliar with combo box form controls let me know if anything I just described sounds dumb/not possible.

Second, I would like your assistance in creating cascading drop downs for the combo boxes, I found that the method describe in the previously linked question will not work for combo boxes. Therefore, I'm looking for an alternative solution.... Let me know what you can do and thank you in advance.

Dummy File is attached.
CDD-EE-Sample.xlsx
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

I see no reason why you still cannot use Data Validated cells in your common UI workspace across the worksheets.   Is it your intention to have the values editable in any sheet, yet display the same values as you move from sheet to sheet?

A combination of indexing functions (ex., VLOOKUP) and Worksheet_Activate events could accomplish this.

By the way, the example you provided does not demonstrate cascading or dependent selections; they're independent of each other.

Regards,
-Glenn
Avatar of -Polak

ASKER

Hi Glenn, yes that is exactly what I need..... the drop down cells in the UI workspace (really just a frozen top row of cells) to be editable in any sheet yet display the same values as you move sheet-to-sheet....

My impressions was if I just copy and pasted the data-validated cells on each sheet that there wouldn't be a way to link them so that if a change was made on one sheet it would be accomplished on another.

ALSO, because I'm using a freezing a SINGLE row for my UI workspace using combo boxes was easier from a formatting perspective as I am unaware of a way to freeze multiple data validated cells to keep the UI workspace "floating".

Regarding the example yes, that is what I needed the majority of help with.... or so I thought until you told me there is an easier workaround than using combo boxes (which represent the same value across multiple sheets).
ASKER CERTIFIED SOLUTION
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of -Polak

ASKER

I see what you did there... that would work, but going back to what I said about formatting. Is there a way to incorporate multiple data validated cells into a floating UI/Navigation.... I'm currently freezing the top row so combo boxes seemed to be a better solution and hence why I embarked down trying to figure out if combo boxes could cascade. (See attached)
Navigation-Mock-Up-EE.xlsx
I'm not sure I see what the issue might be.  In my example, one would just freeze panes at row 2, leaving rows 1 and 2 static and allow everything below scrollable.
Avatar of -Polak

ASKER

Well I feel like an idiot now, I never knew that dragging from the top-down vs. the bottom-up would produce a different freeze pane results (4 panes*not desired* vs. 2 panes). Now, that I've figured that out, you can continue with your solution; however, if you were just going to accomplish the cascading using the solutions described by either of the members in my previously linked solution I can manage from here. If you have another way to go about it please let me know.

FYSA in the production version of this spreadsheet the are three layers of cascading with 5 options in the 1st, 29 options in the second, and 30 options in the 3rd. I'd be interested to know if there was a non-VBA method to cascade the lists if a user didn't follow the "order of selection" (ala. they went one, two, three and then went back to #2 and made a change).
Hi,
I wasn't planning on changing any methodology in terms of dependent/cascading data validation.  However, this method only works in an hierarchal order, that is, the "children" values require a parent value to be selected in order to work.  One can't jump around and select in any order.  However, updating an earlier-selected value is acceptible; but it might require selecting new children values to have a valid total selection.

-Glenn
Avatar of -Polak

ASKER

Thanks Glenn I've posted what I ended up doing, and the VBA you posted earlier works just great. (as a note I only focused on "Region" (M2) for the EE File)

Quick question regarding how I achieved the cascading, I used one of the methods described in my previously answered question as it saved me a lot of time from having to create a bunch of named ranges. However, its not very intuitive to understand.  Here are the formulas for the 3 named ranges used in the data validation lists:

Region: =Menus!$A$2:INDEX(Menus!$A:$A,MATCH("ZZZZZZZ",Menus!$A:$A))
Branch: =Indirects!$A$2:INDEX(Indirects!$B:$B,MATCH("ZZZZZZZ",Indirects!$B:$B))
CascadeBranch: =INDEX(Indirects!$B:$B,MATCH(Standard!M2,Indirects!$A:$A,0)):INDEX(Indirects!$B:$B,MATCH(Standard!M2,Indirects!$A:$A,0)+COUNTIF(Indirects!$A:$A,Standard!M2)-1)

Note that in "CascadeBranch" M2 will change to the row directly above the cell you have highlighted because its not an absolute reference.

I'm generally confused about matching "ZZZZZZZ" (doesn't exist) and how addition and subtraction is being applied to the Index and Match functions contained in CascadeBranch.....
EE-Safe-Cascading.xlsm
Avatar of -Polak

ASKER

VBA worked to solve my issues, let me know if you can clarify how the cascading was achieved.
Avatar of -Polak

ASKER

Hi Glenn as a follow-up, if I wanted your macro to run if someone were to press the "delete" key when using any of the drop-downs what would I have to do to the code?