How to create named ranges based on tree structure to be used for dropdowns

Columbus5

New Member
Joined
Oct 26, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I have a tree (data) structure (see below) from which I would like to create dynamic drop down lists that will be in another workbook for users to answer. The drop downs in the other workbook will be based on the formula of indirect as I want users to get pre-selected options to answer (e.g. if you answer Europe as Region in first dropdown, you should only be able to see countries in Europe as selection options in the next dropdown, and so forth). My idea around this is to create named ranges for each level in the tree structure (e.g. all countries belonging to Europe are defined as Europe, and all cities belonging to Denmark are defined as Denmark) to enable indirect formula in the dropdowns. However, the document contains several hundreds of rows and I want to create the named ranges automatically based on the hierarchical structure. I assume a macro is needed for this. It would be very appreciated if someone can help me with this?
RegionCountryCityOffice
EuropeDenmarkCopenhagenFredriksberg
North AmericaUSALos AngelesMalibu
EuropeFranceParisLa Défense
AsiaChinaShanghaiHongqiao
EuropeDenmarkCopenhagenNyhavn
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Welcome to the forum.

I think this webpage might include the answer for you regarding dependent data validation. It just might be that a macro will be what you end up needing, but I think that material is relevant.
 
Upvote 0
Welcome to the forum.

I think this webpage might include the answer for you regarding dependent data validation. It just might be that a macro will be what you end up needing, but I think that material is relevant.

Hi, the webpage supports me to a certain extent but not fully. I have several multiple precedents in second and third column and I only want unique names in the dropdowns. I am not able to manage that with a large selection of data automatically. any advice on formulas for dropdowns that are only identifying unique values from the columns and connecting them to underlying names automatically?
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,959
Latest member
camelliaCase

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