Originally Posted by
Juan Pablo Gonz?lez
The INDIRECT() approach does work for me in 2000. However, I have a method that doesn't require the definition of a gizzilion names so that INDIRECT() works.
Using an 'Admin' sheet with a layout like this:
{"Countries","USA","Colombia","","";
"USA","California","Washington","Florida","Illinois";
"Colombia","Antioquia","Cundinamarca","Valle","";
"California","LA","San Diego",0,0;"Washington","Seattle","Redmond","","";
"Florida","Miami","Ft Lauderdale","Orlando","";
"Illinois","Chicago","Marion","Carbondale","";
"Antioquia","Medellin","Bello","","";
"Cundinamarca","Bogota","Chia","Suba","";
"Valle","Cali","Buga","",""}
that is, the "name" of each list in column A, and from B to IV the possible options.
First, create 'BigStr' defined as
=REPT("z",255)
Then, we create the "main" list, 'Countries', which refers to:
=Admin!$B$1:INDEX(Admin!$1:$1,MATCH(BigStr,Admin!$1:$1))
Now, I'll use this lists in Sheet2, where column A will have the country, column B the state/department, and column C the city.
So, in Sheet2, select column A, go to Data | Validation, select "List" and put
=Countries
as the source.
Now, select B1 in Sheet2. This steps is implicitly required for the lists to work ok.
The next name will find the row in Admin that contains the list. Define 'ColListNum' as
=MATCH(Sheet2!A1,Admin!$A:$A,0)
(Note the relative and absolute references)
Now, define 'ColList' as
=INDEX(Admin!$1:$65536,ColListNum,0)
this will retrieve the entire row into a range.
Finally, define 'List' as
=INDEX(ColList,2):INDEX(ColList,MATCH(BigStr,ColList))
Those are the names that we need.
Now, still in Sheet2, select columns B and C.
Go to Data | Validation, select "List" and enter
=List
as the source
Now you can add or delete lists (and their options) without having to redefine anything.