How to create a dynamic data validation from a table based on criteria

GlobalTraveler

New Member
Joined
Oct 2, 2014
Messages
1
I have the following table.

[TABLE="width: 448"]
<tbody>[TR]
[TD] [/TD]
[TD="colspan: 2"]United States[/TD]
[TD="colspan: 2"]Hong Kong[/TD]
[TD="colspan: 2"]India[/TD]
[/TR]
[TR]
[TD]Job Grade[/TD]
[TD]Per Hour[/TD]
[TD]Per Day[/TD]
[TD]Per Hour[/TD]
[TD]Per Day[/TD]
[TD]Per Hour[/TD]
[TD]Per Day[/TD]
[/TR]
[TR]
[TD]USD[/TD]
[TD]USD[/TD]
[TD]HKD[/TD]
[TD]USD[/TD]
[TD]INR[/TD]
[TD]USD[/TD]
[/TR]
[TR]
[TD]P[/TD]
[TD] 1,600 [/TD]
[TD] 12,800 [/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] 24,150 [/TD]
[TD] 3,145 [/TD]
[/TR]
[TR]
[TD]D1[/TD]
[TD] 1,000 [/TD]
[TD] 8,000 [/TD]
[TD] 6,950 [/TD]
[TD] 7,158 [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]D2[/TD]
[TD] 900 [/TD]
[TD] 7,200 [/TD]
[TD] 6,250 [/TD]
[TD] 6,437 [/TD]
[TD] 17,850 [/TD]
[TD] 2,325 [/TD]
[/TR]
[TR]
[TD]SM1[/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]SM2[/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]M[/TD]
[TD] 700 [/TD]
[TD] 5,600 [/TD]
[TD] 5,200 [/TD]
[TD] 5,356 [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]AM1[/TD]
[TD] 500 [/TD]
[TD] 4,000 [/TD]
[TD] 3,350 [/TD]
[TD] 3,450 [/TD]
[TD] 9,450 [/TD]
[TD] 1,231 [/TD]
[/TR]
[TR]
[TD]AM2[/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]S1[/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]S2[/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]S3[/TD]
[TD] 350 [/TD]
[TD] 2,800 [/TD]
[TD] 3,000 [/TD]
[TD] 3,090 [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]S4[/TD]
[TD] 280 [/TD]
[TD] 2,240 [/TD]
[TD] 2,750 [/TD]
[TD] 2,832 [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
[TR]
[TD]A1[/TD]
[TD] 175 [/TD]
[TD] 1,400 [/TD]
[TD] 1,000 [/TD]
[TD] 1,030 [/TD]
[TD] 6,300 [/TD]
[TD] 821 [/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD] 135 [/TD]
[TD] 1,080 [/TD]
[TD] 1,000 [/TD]
[TD] 1,030 [/TD]
[TD] [/TD]
[TD] - [/TD]
[/TR]
</tbody><colgroup><col span="7"></colgroup>[/TABLE]


I have a combo box (CB1) that uses a Dynamic Named Range of the Country Names as a Data Validation so the list would be and would expand dynamically as I added countries to the right

CB1
----------------------
United States
Hong Kong
India

In another combo box (CB2) where I want to have a dynamic data validation that lists on the Job Grades that have a USD Per Day amount for the selected Country.

So for example if in CB1 the user selects India then the Data Validation in CB2 would be:

CB2
----------------------
P
D2
AM1
A1

Notice the list contains only those job grades where the USD Per Day is blank (or could also use 0, I don't care what we compare againt blank or 0 as I can set the USD amount to either).

Just as the Named Range I use for CB1's data validation is dynamic and expands as colums are added to the right I would like this combo box data validation to also be dynamic and expand right as columns (countries) or down as rows (Job Grades) are added.

FYI: I usually use OFFSET in my dynamic named ranges instead of INDEX so that I don't have to worry about sorting, etc.

Thanks
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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