
Dear Forum members,
In one sheet I have a two column table with countries and cities.
I another sheet I am booking data and would like to select in one field the country from a validation drop down list.
Based on the selection of the country I would like in the next field to the right to select the city from a validation drop down list. The drop down list should display only the cities that are in that country.
Example:
COUNTRY CITY
France Paris
France Lyon
Italy Rome
Italy Milan
Australia Sidney
Australia Melbourne
etc.
When selecting "France" from the dropdown (lets say in cell A2) then I should get in the drop down of cell B2 only the cities "Paris" and "Lyon" and not the whole list of cities.
I thought that is a very common situation but I am struggling with that since a week and did not find the answer on internet.
Does anybody have a solution ?
Many thanks,
Olivier

Active Member

July 1, 2016

Hello Olivier,
See http://www.contextures.com/xlD.....Val02.html for how to make a dependant drop down list.
regards, Henk.


July 16, 2010

Hi Olivier,
There are two ways to achieve dependent data validation lists:
1. The easy way (similar/same as Contextures): https://www.myonlinetraininghu.....dent-lists
2. The more complex way but incredibly slick and completely dynamic: https://www.myonlinetraininghu.....validation
Mynda

Many thanks All,
I have found the link to Contexture before but I don't think this answers my case.
The way that is described by Contexture would force me to have as many columns in my data sheet as number of countries (1 list for each country). Imaging there are 160 countries (and this is just an example because my case is actually >10000 customers with 5 to 10 contracts).
We could even have additional dimensions like street names, then the proposed solution does definitely not support it.
"Country" "City" "street_name"
When selecting a country then the drop down list should be limited to the cities of that country and street_names to the streets of that city.
Many thanks,
Olivier


July 16, 2010

Hi Olivier,
Dynamic Data Validation isn't something built into Excel, and so getting it to work is done with a clever use of named ranges. As a result it's not scalable to the degree you're after.
You may be able to build a VBA data validation model but I don't have any tutorials I can point you to, sorry. You could try posting your question in the VBA forum.
Mynda

VIP

Trusted Members

June 25, 2016


Active Member

July 9, 2016

Hi Olivier,
I found a good solution using pivot tables that will allow you to create cascading data validation lists. No VBA required.

Answers Post

Active Member

July 1, 2016

Olivier,
There are so many ways to do things in Excel. I have an other solution.
I just use one table with 2 columns. The first column shows the combination of all the choosen data validation-fields, the second column shows the new texts to show in the next data-validation-cell.
Maybe a little confusing (my english is not perfect) but see the attached file where you can find the data-validation in the three yellow cells and hopefully you'll understand the working of it.
Regards, Henk.


July 16, 2010

Thanks for sharing your solution, Henk. Another one I've not seen before.
My only concern is that the lists would be difficult to maintain. I suppose if the data was not likely to change then it would be ok as a one off job, but if it was a list of products or other items that were more fluid, then I'd prefer the PivotTable method as it's more dynamic.
Mynda
1 Guest(s)
