跳到主要內容

如何隱藏下拉列表中以前使用的項目?

在Excel中,您可以快速創建一個正常的下拉列表,但是當您選擇一個項目時是否曾經嘗試創建一個下拉列表,以前使用過的項目將從列表中刪除嗎? 例如,如果我有一個包含100個名稱的下拉列表,則在選擇一個名稱時,我想從下拉列表中刪除此名稱,現在該下拉列表包含99個名稱,依此類推,直到下拉列表為空。 也許這對我們大多數人來說有些困難,在這裡,我可以討論如何在Excel中創建這樣的下拉列表。

使用幫助器列在下拉列表中隱藏以前使用的項目


箭頭藍色右氣泡 使用幫助器列在下拉列表中隱藏以前使用的項目

假設您在A列中有一個名稱列表,如下面的屏幕快照所示,然後按照以下步驟一個接一個地完成此任務。

doc隱藏使用的項目下拉列表1

1。 除了您的姓名列表,請輸入以下公式 = IF(COUNTIF($ F $ 1:$ F $ 11,A1)> = 1,“”,ROW()) 進入單元格B1,請參見屏幕截圖:

doc隱藏使用的項目下拉列表1

備註:在以上公式中, F1:F11是您要放入下拉列表的單元格範圍,並且 A1 是您的名字單元格。

2。 然後將填充手柄拖到包含此公式的範圍內,您將得到以下結果:

doc隱藏使用的項目下拉列表1

3。 並繼續在C列中應用公式,請輸入以下公式: =IF(ROW(A1)-ROW(A$1)+1>COUNT(B$1:B$11),"",INDEX(A:A,SMALL(B$1:B$11,1+ROW(A1)-ROW(A$1)))) 進入單元格C1,請參見屏幕截圖:

doc隱藏使用的項目下拉列表1

4。 然後將此公式填充到所需範圍,請參見屏幕截圖:

doc隱藏使用的項目下拉列表1

5。 現在,您需要在列C中為這些名稱定義一個範圍名稱,選擇C1:C11(您在步驟4中應用公式的範圍),然後單擊 公式 > 定義名稱,請參見屏幕截圖:

doc隱藏使用的項目下拉列表1

6。 在 新名字 對話框中,在“名稱”文本框中鍵入一個名稱,然後輸入此公式 =OFFSET(Sheet2!$C$1,0,0,COUNTA(Sheet2!$C$1:$C$11)-COUNTBLANK(Sheet2!$C$1:$C$11),1) 字段,請參見屏幕截圖:

doc隱藏使用的項目下拉列表1

備註:在上面的公式中,C1:C11是您在步驟3中創建的幫助列範圍,工作表2是您正在使用的當前工作表。

7。 完成設置後,您可以創建一個下拉列表,選擇要放置下拉列表的單元格F1:F11,然後單擊 數據 > 數據驗證 > 數據驗證,請參見屏幕截圖:

doc隱藏使用的項目下拉列表1

8。 在 數據驗證 對話框,單擊 設定 標籤,然後選擇 名單 來自 下拉列表,然後在 資源 部分,輸入以下公式: =名稱檢查名稱檢查 是您在步驟6)中創建的範圍名稱,請參見屏幕截圖:

doc隱藏使用的項目下拉列表1

9。 然後點擊 OK 按鈕關閉此對話框,現在,已在選定範圍內創建下拉列表,並且從下拉列表中選擇一個名稱後,該使用的名稱將從列表中刪除,並且僅顯示未使用的名稱,請參見屏幕截圖:

doc隱藏使用的項目下拉列表1

尖端:您無法刪除在上述步驟中創建的幫助程序列,如果刪除它們,則下拉列表將無效。


相關文章:

如何在Excel中插入下拉列表?

如何在Excel中快速創建動態下拉列表?

如何在Excel中使用圖像創建下拉列表?

最佳辦公生產力工具

🤖 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 (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Does any one know how to get the formula to reset itself once all the items on the list are selected?
e.g.
List 1, 2, 3, 4 - Then after selecting 1, List 2, 3, 4 - Then after Selecting 2, List 3, 4 - Then after selecting 3, List 4 and last, after selecting 4, list empty. How can this be reset so that after you select 4, all the items in the list reset to original list? So, after selecting 4, instead of List being empty, for list to go back to List 1, 2, 3, 4.

Thank you
This comment was minimized by the moderator on the site
This worked like a charm ... expect I need to have this "repeat" in three places on the same spreadsheet. I can't make it function properly, the second time. The items from the first drop down list are eliminated but when an entry is selected in the second location, it isn't removed from the list. Any idea on how to may this function properly?
KL
This comment was minimized by the moderator on the site
Can this formula be used successfully across multiple columns on one spreadsheet? I'm trying to have three columns where someone can select up to three items from a drop down list, i.e. item 1 in column 3, items2 in column 4, and item 3 in column 5. I can get the formula to work at the first occurrence, however, the second time I try to copy the formula, the selection(s) don't disappear from the drop down list, as they do in the column of the first occurrence.
This comment was minimized by the moderator on the site
Bravo! Fantastic solution! I have my workbook set up such that the items in my list are in a separate worksheet that I'm index-matching to through my number and helper columns leaving only them two on my calculation page. Again, very clean solution, Programmer!
This comment was minimized by the moderator on the site
Step 6 isn't working for me. I keep getting an error message saying the syntax of this name isn't correct... Can anyone help?
This comment was minimized by the moderator on the site
Is there a way to have only some of the options get removed when selected and others be permanent?
This comment was minimized by the moderator on the site
How do I get this activity to work if I transpose from Row to Column
This comment was minimized by the moderator on the site
I’ve entered all the formulas correctly, but the only name showing up is the first one on the list. What am I doing wrong??
This comment was minimized by the moderator on the site
Works great, however, if you have two people on the list with the same name e.g. John Smith it removes both incidents of 'John Smith' from the list when you select one of them.


Is there a way to amend this so that you have have multiple versions of the one name without them all being removed?


Thanks.
This comment was minimized by the moderator on the site
How would you change this formula for use of data validation list across multiple rows instead of a single column. Is that possible? Thanks
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations