I want to create a second drop down Select part
that is conditional based on the part that matches the device. See the data sheet below.
The idea is that if the user selects from the Select device
drop down something like Computer
the only options available under Select part
will be Ram
and CPU
.
I am using the Excel data validation -> validation criteria -> list
function to do this.
The data sheet is text only.
From Data sheet the heading _Device[1]_
is for the first drop down and the headings _Part_
and _Device[2]_
are the matrix ready for the second drop down.
The key requirements are that the drop down sheet has only two drop downs, devices and parts, and the data sheet has only text and nothing else.
Drop down sheet
_Select_ _Drop down_
Select device
Select part
Data sheet
_Device[1]_ _Part_ _Device[2]_
Computer Ram Computer
Car CPU Computer
Fridge Window Car
Seat Car
Door Fridge
Holder Fridge
Answer
What you are after is called dependent data validation. Debra Dalgleish has a tutorial about that.
Tbe idea is that you have a list of sub-items for each major item and you assign range names to the list of sub-items that correspond to the name of the major item. Then you can use Indirect() with the major item name to produce the list of sub-items in the data validation list.
You may need to re-arrange your data layout for this approach.
If you don't want or can't do that, there is another option with dynamic range names, but it requires that the data is sorted ascending by the column you call "Device[2]". If you want to look at that, post a comment and I'll explain.
Comments
Post a Comment