跳到主要内容

如何隐藏下拉列表中以前使用的项目?

在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

Tips::您无法删除在上述步骤中创建的帮助程序列,如果删除它们,则下拉列表将无效。


相关文章:

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

如何在Excel中快速创建动态下拉列表?

如何在Excel中使用图像创建下拉列表?

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 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