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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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