@StringJazzer
Thanks for reviewing my code.
There's another option which is using an UDF, without using actual Table.
Example:
Dependent data validation in A2:B7, the list in Country & City are dynamic.
How to set it up:
1. Insert this UDF in a code module:
2. Create a named range "COUNTRY", refer to: = 'SHEET2'!$A$2:INDEX('SHEET2'!$A:$A, COUNTA('SHEET2'!$A:$A), 1)
3. You must select the first dependent cell i.e B2 then create a named range "toXDAV", refer to: =xdav(Sheet1!$A2,Sheet2!$C$1:$Z$1)
4. Select A2:A7 create data validation > List > Source: =COUNTRY
5. Select B2:B7 create data validation > List > Source: =toXDAV
Note:
In sheet2, the headers of the list are actually on C1:E1, but I set it to $C$1:$Z$1 in the formula, so you can add more Country without having to change the formula.
Bookmarks