跳到主要内容

如何创建动态数据验证并自动扩展下拉列表?

通常,在工作表中创建下拉列表时,下拉列表不会随着动态输入新数据而更改,在这种情况下,您需要修改源数据以手动扩展列表。 在本文中,我将介绍如何动态地进行数据验证并在输入新数据时自动扩展下拉列表。

创建动态数据验证并通过创建表自动扩展下拉列表

创建动态数据验证并通过定义范围名称自动扩展下拉列表


箭头蓝色右气泡 创建动态数据验证并通过创建表自动扩展下拉列表

要创建动态数据验证列表,可以先创建一个表,然后再应用数据验证功能。 请执行以下操作:

为源数据列表创建表格式:

1。 选择要用作下拉列表的源数据的数据列表,然后单击“确定”。 插页 > ,在弹出 创建表 对话框,检查 我的桌子有标题 如果您的数据列表包含标题,请参见屏幕截图:

doc动态数据验证1

2。 然后点击 OK 按钮,表格已创建,请参见屏幕截图:

doc动态数据验证2

定义表的范围名称:

3。 然后选择已创建但忽略标题的表,并在表中键入该表的名称。 名字 框,然后按 输入 键,请参见屏幕截图:

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