Reputation: 473
Hi I'm just wondering if there is a way to in Excel have a drop down menu that changes with the number of entries in the column.
I am currently using: Data - Data Validation - List, to create my drop down menu.
As I am adding more entries below the Source range of the List I was wondering if there is a way to dynamically update this range? I have written VBA forms and can achieve a similar result using those but I am just wondering if this can be streamlined by not having a form popup for my search.
Also is there a way to have entries only added to the list based on a condition?
Thanks for any help.
Upvotes: 0
Views: 355
Reputation: 26640
You would use a dynamic named range. So let's pretend you have a worksheet specifically designated for your dynamic drop-down list source. We'll call the sheet "List" and we'll put the entries in column A starting in cell A1.
Now create a named range (we'll name this range listData
) with this formula:
=List!$A$1:INDEX(LIST!$A:$A,MATCH(REPT("z",255),LIST!$A:$A))
Steps to create a named range: Go to Data -> Named Range -> New
Now for your data validation list, simply set it to the named range:
=listData
Upvotes: 1