跳到主要內容

如何創建動態數據驗證並自動擴展下拉列表?

通常,在工作表中創建下拉列表時,下拉列表不會隨著動態輸入新數據而更改,在這種情況下,您需要修改源數據以手動擴展列表。 在本文中,我將介紹如何動態地進行數據驗證並在輸入新數據時自動擴展下拉列表。

創建動態數據驗證並通過創建表自動擴展下拉列表

創建動態數據驗證並通過定義範圍名稱自動擴展下拉列表


箭頭藍色右氣泡 創建動態數據驗證並通過創建表自動擴展下拉列表

要創建動態數據驗證列表,可以先創建一個表,然後再應用數據驗證功能。 請執行以下操作:

為源數據列表創建表格式:

1。 選擇要用作下拉列表的源數據的數據列表,然後單擊“確定”。 插入 > 枱燈,在彈出 創建表格 對話框,檢查 我的桌子有標題 如果您的數據列表包含標題,請參見屏幕截圖:

doc動態數據驗證1

2。 然後點擊 OK 按鈕,表格已創建,請參見屏幕截圖:

doc動態數據驗證2

定義表的範圍名稱:

3。 然後選擇已創建但忽略標題的表,並在表中鍵入該表的名稱。 姓名 框,然後按 Enter 鍵,請參見屏幕截圖:

doc動態數據驗證3

創建一個動態數據驗證列表:

4. 定義表的名稱後,然後選擇要在其中插入下拉列表的單元格,然後單擊 數據 > 數據驗證 > 數據驗證,請參見屏幕截圖:

doc動態數據驗證4

5。 而在中 數據驗證 對話框中的 設定 標籤,選擇 名單 來自 部分,然後輸入以下公式: =名稱清單 (名單 是您在步驟3)中為表格創建的名稱 資源 文本框,請參見屏幕截圖:

doc動態數據驗證5

6。 然後點擊 OK 按鈕,下拉列表已插入到選定的單元格中,從現在開始,當您在源數據列表中輸入新名稱時,它也會自動添加到下拉列表中,請參見屏幕截圖:

doc動態數據驗證6


箭頭藍色右氣泡 創建動態數據驗證並通過定義範圍名稱自動擴展下拉列表

除了創建表之外,您還可以通過使用公式定義範圍名稱來完成此任務,請執行以下步驟:

1。 點擊 公式 > 定義名稱,請參見屏幕截圖:

doc動態數據驗證7

2。 在 新名字 對話框中,指定一個名稱作為所需的名稱列表,然後鍵入以下公式: = OFFSET(Sheet1 $ A $ 2,0,0,COUNTA(Sheet1 $ A:!$ A),1) 文本框,請參見屏幕截圖:

doc動態數據驗證8

備註:在以上公式中, Sheet1 是工作表名稱包含數據列表, A2 是數據列表中的第一個單元格, 答: 是具有數據列表的列。

3。 點擊 OK 按鈕,然後轉到 數據驗證 通過單擊對話框 數據 > 數據驗證 > 數據驗證數據驗證 對話框中選擇 名單 來自 部分,然後輸入以下公式: =名稱清單 (名單 是您在步驟2)中創建的名稱 資源 文本框,請參見屏幕截圖:

doc動態數據驗證9

4。 然後點擊 OK,現在,當您在數據列表中輸入新名稱時,下拉列表將自動擴展。 看截圖:

doc動態數據驗證10

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (10)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
There is a nice new method when using a spill function like: =UNIQUE()
With this you can easily create a UNIQUE list of your current dataset.

When this formula is is in cell A2. Then use in the data validation source field the following: =A2#

This will automatically update the range without a blank row.
This comment was minimized by the moderator on the site
Thank you !
Rated 5 out of 5
This comment was minimized by the moderator on the site
Thank you very much, it is very powerful and simple solution at the same time.
This comment was minimized by the moderator on the site
thanks for this. Really helpful
This comment was minimized by the moderator on the site
Do you know how to create a dynamic range using drop boxes to expand and contract the data range to be graphed (without deleting any data or hiding it)? I've only seen one person do this. https://youtu.be/sHfWRb2yUrM
Unfortunately I need to do this on a mac.
This comment was minimized by the moderator on the site
Thansk for the info - just what I was looking for!!
This comment was minimized by the moderator on the site
I get "The source currently evaluates to an error" on Step 4 of "Create Dynamic Data Validation And Auto Extend The Drop Down By Defining Range Name"
This comment was minimized by the moderator on the site
Solution was to put name of the sheet, e.g. MyLists, rather than Sheet1 in Step 2
This comment was minimized by the moderator on the site
I LOVE YOU!
This comment was minimized by the moderator on the site
I find it is more simple to use a Table than write this whole Offset function. However since a Table cannot be used directly as a data validation source, I have to create a Name that refers to the Table[Column], and point the data validation list to the Name.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations