Reputation: 1
I have a set of key-value type pairs in excel. For each key-value pair I have a unique list of items that I would like to be the contents of a drop down menu in a separate worksheet. In order to make a drop down menu, excel data validation wants to reference a range of cells to select from.
My question is: Instead of referencing a range of cells for the data validation list, can the data validation list be contained in a single cell corresponding to its key-value pair?
for example:
key | value | [list, of, accepted, values, in, drop-down] |
I suppose I could write a macro to manually check and validate the entered text against the list of accepted values using VBA string comparisons, but this seems tedious and loses the drop down menu capability.
Upvotes: 0
Views: 63
Reputation: 759
i see two possible ways.
if there is a limited number of possible entries, you could fill the referecnig-range with formulas, that choose the possible entries. If you change your list to something like
key&No | value
X1|valueforX1
X2|valueforX2
Y1|valueforY1
Y2|valueforY2
you can then get the values with a vlookup for "key&No"
Upvotes: 0