(Sub)Categories

  • Thread starter Thread starter shlap
  • Start date Start date
S

shlap

I'd like to fill the Subcategory drop-down list based on the selectio
of the Category drop-down list. I'm an excel newbie. Can anyone poin
me in the right direction as to how to accomplish this? Thanks
 
Here is a write-up I have on what you want to do. Post back if you need
more. HTH Otto
Say that you have Data Validation in cell A5 that has a list
like Fruit, Furniture, Cars, Airplanes. A second cell, say B5, has a
validation list also.
But you would like for the validation list in B5 to be a list of things
associated with the
subject chosen in the first validation list. In other words, if the user
chooses cars in
the first validation list and then activates the second data validation cell
list, he will
see a list about cars. This is how:

You can do this without VBA. The trick is to create names for your lists.
Make the
names of your lists the same as the items in your first validation list
(i.e., Fruit, Furniture,
Cars, Airplanes, etc.).

For the second data validation list, specify this formula:
=INDIRECT(A5)
(This assumes that your first data validation cell is A5.)

Note that the above procedure is for only one Data Validation cell dependent
on another
Data Validation cell. It doesn't work for more than one. VBA will have to
be used if there
are more than one of the other Data Validation cells.
 
It does work in more than two validated cells. I referenced B5 in C5,
and referenced A5 in B5 using the indirect function as you state. Thus
selecting in A5 sets a list in B5, and when a selection is made in B5,
the list is generated in C5.
One thing I cant get done, which I would like to do, without code, is
when changing the selection in A5 from the validated list, have the
previous selection in B5 and C5 blank out. Any thoughts?
 
Back
Top