Dependent validation list with table as source

rickbisselink

Board Regular
Joined
Oct 16, 2007
Messages
146
Hi all,

Could not find the solution elsewhere that combines my following questions, so I hope one of you has the solution!

I am trying to dependent validation list, where the source data is in one table (A1:C14). The table headers are generic and so cannot be used to refer to for the second validation list. The values in each of the columns in the table are not unique, so the validation lists need to have distinct values. Please find below my (test) worksheet, the validations would go into cells E2, F2 and G2, where F2 is dependent on E2 and F2 is dependent on E2 and F2.

Hope I'm making myself clear, thanks for your responses!

Kind regards,
Rick


Book1
ABCDEFG
1DayNameProductDayNameProduct
2MondayJohnApple
3MondayJohnPear
4MondayPeterOrange
5MondayPeterBanana
6MondaySteveKiwi
7TuesdayKarenOrange
8TuesdayDavidMango
9TuesdayJaneTomato
10WednesdayPeterStrawberry
11WednesdayRyanKiwi
12WednesdayKarenLemon
13WednesdayAnneRaspberry
14WednesdayTomLemon
Sheet1
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi rick,

You could create 3 pivot tables
1) - Show Day in the Row labels
2) - Show Name in the Row labels
3) - Show Product in the Row labels

Then use a data validation on the pivot table list, as pivot tables group together duplicate values the list will be unique.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Row Labels[/TD]
[TD]Row Labels[/TD]
[TD]Row Labels[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[TD]Anne[/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]Tuesday[/TD]
[TD]David[/TD]
[TD]Banana[/TD]
[/TR]
[TR]
[TD]Wednesday[/TD]
[TD]Jane[/TD]
[TD]Kiwi[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD]John[/TD]
[TD]Lemon[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Karen[/TD]
[TD]Mango[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Peter[/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Ryan[/TD]
[TD]Pear[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Steve[/TD]
[TD]Raspberry[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Tom[/TD]
[TD]Strawberry[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Grand Total[/TD]
[TD]Tomato[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Grand Total[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Thanks Mick, that works like a charm! Is VBA the only way to do this (in case a user has macro restrictions due to security settings)?

Tyija, in order to make your solution work, the contents of second pivot table should be dependent on the first chosen value. How do you picture this?

Rick
 
Upvote 0
Hi Rick,

You could edit the 2nd pivot table to show Day and then Name so in your example it would look like this:

[TABLE="width: 100"]
<tbody>[TR]
[TD]Names[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[/TR]
[TR]
[TD="align: center"]John[/TD]
[/TR]
[TR]
[TD="align: center"]Peter[/TD]
[/TR]
[TR]
[TD="align: center"]Steve[/TD]
[/TR]
[TR]
[TD]Tuesday[/TD]
[/TR]
[TR]
[TD="align: center"]David[/TD]
[/TR]
[TR]
[TD="align: center"]Jane[/TD]
[/TR]
[TR]
[TD="align: center"]Karen[/TD]
[/TR]
[TR]
[TD]Wednesday[/TD]
[/TR]
[TR]
[TD="align: center"]Anne[/TD]
[/TR]
[TR]
[TD="align: center"]Karen[/TD]
[/TR]
[TR]
[TD="align: center"]Peter[/TD]
[/TR]
[TR]
[TD="align: center"]Ryan[/TD]
[/TR]
[TR]
[TD="align: center"]Tom[/TD]
[/TR]
</tbody>[/TABLE]

I guess it would depend how often you're adding to the table though.
 
Upvote 0
Mick,

One more question: how would the VBA code change if the validation were not just in one row (E2:G2), but in multiple rows (E2:G2, E3:G3, E4:G4 etc.)?
 
Upvote 0

Forum statistics

Threads
1,223,949
Messages
6,175,581
Members
452,653
Latest member
craigje92

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