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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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.

Row LabelsRow LabelsRow Labels
MondayAnneApple
TuesdayDavidBanana
WednesdayJaneKiwi
Grand TotalJohnLemon
KarenMango
PeterOrange
RyanPear
SteveRaspberry
TomStrawberry
Grand TotalTomato
Grand Total

<tbody>
</tbody>
 
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:

Names
Monday
John
Peter
Steve
Tuesday
David
Jane
Karen
Wednesday
Anne
Karen
Peter
Ryan
Tom

<tbody>
</tbody>

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,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

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