简体   繁体   中英

Excel Dynamic Drop Down Menu

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM