validation list help

d0wnt0wn

Well-known Member
Joined
Oct 28, 2002
Messages
771
hi i have made 3 validation lists... this may sound a bit backwads but it is the only way i could figure out how to do this....

my top list selects a manufacturer

my middle list brings up a material category based on the first lists selection

my bottom brings up a material accessories list based on the top selection


the problem is that when i select the manufacturer in the top list the bottom two lists still show the materials for the old manufacturer untill a manual change is made to that list. Is there any way that i can have the bottom 2 lists automatically convert once the manufacturer is selected... or at least can i make something happen that will force the users to make changes to the bottom two lists..... or is there a better way to accomplish this altogether?
 
Hi d0wnt0wn,

There are several ways to do this. Probably the easiest is to use named ranges and a Dynamic Named Range to switch between them. This can get unwieldy if the first list has a lot of items so that the second must be capable of switching between many different lists, in which case a VBA-based solution would be preferred. But for now I'll assume your first list has only two manufacturers, Company A and Company B.

First, give the middle (material category) lists used for the two companies names (range names). To do this, select each list (range), then enter a name in the Name box above cell A1. The name must not contain spaces. For this example, I assume you name the two lists "MatCatA" and "MatCatB". Now assume the manufacturer selection dropdown is in cell B4, and you want the dropdown list in C4 to switch from validating using list MatCatA and MatCatB depending on the company selected in B4.

Second, define a Dynamic Range that is calculated according to the value in B4. To do this go to Insert > Define > Define. Under Names In Workbook, enter a name like "MatCat", then in the Refers To box enter the formula

=IF(B4="Company A",MatCatA,MatCatB)

Click Add and OK.

Third, for the Validation list in cell C4 use "=MatCat" as the validation list Source.

That should do it.

I hope you can see from this how you can extend this to handle more companies, and to set up your material accessories lists the same way.

But again, if the number of companies is large you should switch to a VBA implementation. Let me know if you need this. It is not difficult, just a bit different, and can handle a virtually unlimited number of companies and levels of nesting of the lists.

Damon
 
Upvote 0
thanks damon ill try it in the morning.... and no the company list is very small so i wont have to worry about all that... thanks again
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top