Data validation in Excel is a helpful way to verify user input in Excel. The standard way is to (1) define somewhere (e.g. on an auxillary sheet) a list with possible input values and (2) then choose that range in the Source
field. Alternatively, one can also directly type in the different options in that field, e.g:
My question: How do we make the data-validation list dynamic?
What I tried so far is to enter a (possibly user-defined VBA) formula returning a list of strings in into the field Source
of the data-validation dialog, for example
=INDEX({"New","Mint","Very Good","Good","Acceptable","Poor"},{1,RANDBETWEEN(1,6)})
However, this approach does not work as it leads to an error message
You may not use reference operators (such as unions, intersections, and ranges) or array constants for Data Validation criteria.
What do I miss? Which (possibly more elegant) way of making the Source
of the data validation dynamic do you suggest?
Edit: My concrete problem:
On all (but the first) tab sheet, I have a cell called myTest
and the list of allowed values is for a cell on the first tab, where I want be able from the list composed of all possible values of myTest
.
References:
- Debra Dalgleish: "Create Dependent Drop Down Lists" at contextures.com
- Dynamic Data Validation in Excel (Non-VBA!)