excel创建下拉列表多选_如何在Excel中创建下拉列表?

时间:2024-03-14 22:17:39
excel创建下拉列表多选_如何在Excel中创建下拉列表?

excel创建下拉列表多选

Excel provides the drop-down list in order to provide multiple options to select one. The drop-down list can be created in different ways and options. In this tutorial, we will learn how to create a drop-down list for excel.

Excel提供了下拉列表,以便提供多个选项来选择一个。 可以使用不同的方式和选项创建下拉列表。 在本教程中,我们将学习如何为excel创建一个下拉列表。

什么是下拉列表? (What Is Drop-down List?)

The drop-down list provides multiple options where these options are selected from a list that works as a drop-down and select. The selected value or item will be set as the value for the drop-down list.

下拉列表提供了多个选项,可从用作下拉列表的列表中选择这些选项并进行选择。 所选值或项目将被设置为下拉列表的值。

创建下拉列表 (Create Drop Down List)

As the drop-down list consist of multiple options or items of list we need some data source to provides as options in the drop-down list. So we will create a list which is countries in this example which contains, Turkey, UK, Germany, USA, China .We will also put a header for this list which is Items . But using the header is optional.

由于下拉列表包含多个选项或列表项,因此我们需要一些数据源作为下拉列表中的选项提供。 因此,在此示例中,我们将创建一个包含国家/地区的列表,其中包含Turkey, UK, Germany, USA, China 。我们还将在该列表的标头中放置Items 。 但是使用标头是可选的。

In order to use this list as the drop-down list source, we should convert them into a table. We can convert the list by selecting them and using CTRL+T shortcut. We are free to select the header Items but if we select it for conversion then we should express that the table has a header in the table creation dialog box.

为了将此列表用作下拉列表源,我们应该将它们转换为表格。 我们可以通过选择列表并使用CTRL+T快捷键来转换列表。 我们可以*选择标题Items,但是如果选择它进行转换,则应在表创建对话框中表示该表具有标题。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Convert Items To Table
将项目转换为表格

We can see the following screen which will convert given range items into a table. We will check the My table has headers checkbox if we selected the Item header cell.

我们可以看到以下屏幕,它将给定的范围项目转换为表格。 如果选择了项目标题单元格,我们将选中“ My table has headers复选框。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Create Table From the Items
从项目创建表

We can see below that the items are listed inside the table as a table structure where items are colored accordingly. Also the header is colored more dark. We will use the following table in order to create the drop-down list.

我们可以在下面看到,表中列出的项目是作为表结构列出的,其中项目相应地带有颜色。 标头的颜色也更深。 我们将使用下表来创建下拉列表。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Drop-down List Source Table
下拉列表源表

Now we will start the drop-down list creation process. First we will select a cell where the drop-down list will be shown. In this case we select the D2 cell. Then we will open Data Validation from Data Tools menu.

现在,我们将开始下拉列表创建过程。 首先,我们将选择一个显示下拉列表的单元格。 在这种情况下,我们选择D2单元。 然后,我们将从“ Data Tools菜单中打开“ Data Validation

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Open Drop-down list Creation Dialog Box
打开下拉列表创建对话框

Be low we can see the Data Validation screen where we will make some configuration. We will set the Allow: settings as List from the Settings tab. Ignore Blank will ignore blank cells of the table which is useful in most of the cases. In-cell drop-down will create the drop-down action and it must be selected. Source provides the range of the items we want to put into the drop-down list.

较低时,我们可以看到“ Data Validation屏幕,在此处进行一些配置。 我们将从“ Settings标签中将“ Allow:设置设置为“ List SettingsIgnore Blank将忽略表的空白单元格,这在大多数情况下很有用。 In-cell drop-down将创建下拉菜单操作,必须选中它。 Source提供了我们要放入下拉列表的项目范围。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Configure Drop-down List Options
配置下拉列表选项

We can also provides some help information or message about the cell for better user experience. In the Input Message tab we can set some message about the drop down list. We will check the Show input message when cell is selected checkbox and put the Title and Input message values like below.

我们还可以提供一些有关该单元的帮助信息或消息,以提供更好的用户体验。 在Input Message选项卡中,我们可以设置一些有关下拉列表的消息。 我们将选中“ Show input message when cell is selected复选框,然后Input messageTitle和“ Input message值,如下所示。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Drop-down List Configuration
下拉列表配置

When everything is completed we will click OK which will create our drop-down list in the cell D2. We will see the information title and message when we select the given drop-down list cell which is D2. We will also see a square button that will open the drop-down list and items to select.

一切完成后,我们将单击OK,这将在单元格D2中创建下拉列表。 当选择给定的下拉列表单元格D2时,我们将看到信息标题和消息。 我们还将看到一个方形按钮,它将打开下拉列表和要选择的项目。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Drop-down List with Title and Message
带有标题和消息的下拉列表

We will see the following drop-down menu when we click it. All items are list which are Turkey, UK, Germany, USA, China

单击它后,我们将看到以下下拉菜单。 所有项目均列出了Turkey, UK, Germany, USA, China

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Drop-down List Show
下拉列表显示

When we select an option which is Germany, in this case, the value will be shown in the drop-down list cell. This can be very useful to select and read values for different multi-choice applications.

在这种情况下,当我们选择一个选项(德国)时,该值将显示在下拉列表单元格中。 这对于选择和读取不同的多项选择应用程序的值非常有用。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Drop-down List Select Menu
下拉列表选择菜单

通过手动输入数据创建下拉列表(Create Drop Down List By Entering Data Manually)

Another way to provides options to the Drop-down list is providing the data manually. Generally the drop-down options are provided as a table from other cells contents of the Excel. Alternatively we can provide the drop-down list items from the Data Validation dialog box. The process is the same with the creating drop-down list which is described previously. When we arrive the Data Validation dialog box in the source tab we will provide the data manually by separating them with comma. Comma is the separator to delimit drop-down list items.

为下拉列表提供选项的另一种方法是手动提供数据。 通常,从Excel的其他单元格内容中以表格形式提供下拉选项。 或者,我们可以从“数据验证”对话框中提供下拉列表项。 该过程与前面所述的创建下拉列表相同。 当我们到达“源”选项卡中的“数据验证”对话框时,我们将通过用逗号分隔数据来手动提供数据。 Comma是分隔列表项的分隔符。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Drop-down List with Manual Data
带有手动数据的下拉列表

And all other settings and configurations are the same like table data as source.

所有其他设置和配置都一样,例如表数据作为源。

了解更多有关带示例和Range / Xrange函数的Python For Loop教程

通过使用Excel公式/函数创建下拉列表(Create Drop Down List By Using Excel Formulas/Functions)

Up to now, we have provides the drop-down list items like a table or manually. There is another alternative way to provide items for the drop-down list. We can provide the drop-down list items dynamically. We can use some functions in order to create drop-down list items.

到目前为止,我们提供了下拉列表项,例如表格或手动。 还有另一种方法可以为下拉列表提供项目。 我们可以动态提供下拉列表项。 我们可以使用一些功能来创建下拉列表项。

允许不存在的条目 (Allow Not Existing Entries)

By default a drop-down list provides the given items and only one of these items can be selected. No other value can be selected or entered into the drop-down list cell by default. If we need to accept optional values which are not presented in a drop-down list we should disable Show error alert after invalid data is entered checkbox and feature. This features is located in the Error alert tab of the Data validation dialog box like below. It can be change during a drop-down list creation or after the creation by editing the drop-down list properties.

默认情况下,下拉列表提供给定的项目,并且只能选择这些项目之一。 默认情况下,无法选择其他值或将其输入到下拉列表单元格中。 如果我们需要接受下拉列表中未显示的可选值,则应禁用Show error alert after invalid data is entered复选框和功能。 此功能位于“数据验证”对话框的“ Error alert选项卡中,如下所示。 可以在创建下拉列表期间或在创建之后通过编辑下拉列表属性来更改它。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Allow Not Existing Entries
允许不存在的条目

Below we can see that even Spain is not defined as an item of the drop-down list we have typed it into the cell manually.

在下面我们可以看到,甚至Spain也没有定义为下拉列表中的一项,我们已经手动将其键入到单元格中。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Add Manual Data To Drop-Down List
将手动数据添加到下拉列表

添加/删除项目(Add/Remove Items)

New items can be added into the drop-down list easily in different ways. One of the easiest ways is appending the new item into the end of the current source table of the drop-down list. We will add Spain in this example down China which an item of the table. The table will be automatically extended and Spain is added as an item in the drop-down list.

可以通过不同方式轻松地将新项目添加到下拉列表中。 最简单的方法之一是将新项目附加到下拉列表的当前源表的末尾。 在此示例中,我们将在中国下表中添加西班牙。 该表将自动扩展,并且西班牙作为下拉列表中的项添加。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Add/Remove Items
添加/删除项目

删除下拉列表(Remove Drop-down List)

We can remove or delete a drop down list from the Data Validation dialog box. First we will select the cell of the drop-down list. Then we will open the data validation dialog box.

我们可以从“数据验证”对话框中删除或删除下拉列表。 首先,我们将选择下拉列表的单元格。 然后,我们将打开数据验证对话框。

excel创建下拉列表多选_如何在Excel中创建下拉列表?

Then in the settings tab we will click to the Clear All button which will clear the source. Alternative we can clear the source with the backspace or delete.

然后,在设置选项卡中,我们将单击“ Clear All按钮,这将清除源。 或者,我们可以使用退格键清除源代码或删除源代码。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Clear Source Content
清除源内容

After clearing the source content it will look like below as we can see that the Allow setting is any value and data setting is disabled. The last step is clicking OK to apply this setting.

清除源内容后,如下所示,因为我们可以看到“允许”设置为任何值,并且数据设置被禁用。 最后一步是单击“ OK以应用此设置。

excel创建下拉列表多选_如何在Excel中创建下拉列表?
Remove Drop-down List
删除下拉列表

从属/嵌套/多级下拉列表(Dependent/Nested/Multi Level Drop-down List)

Drop-down list can be created in a dependent or nested or multilevel way. All of the same which is simply selected item of the first drop-down list will change the second drop-down item list. This is a hierarchical way. The fist drop-down list is also called parent drop-down list and the second drop-down list is called child drop-down list. Actually dependent drop-down list can be implemented for more than 2 levels like 5 or 10 levels where every child depends its parent selection.

可以以相关或嵌套或多级方式创建下拉列表。 只要是第一个下拉列表的简单选择项,所有这些都将更改第二个下拉列表。 这是一种分层方式。 第一下拉列表也称为父下拉列表,第二个下拉列表称为子下拉列表。 实际上依赖的下拉列表可以实现2个以上的级别,例如5或10个级别,其中每个孩子都取决于其父级选择。

了解更多C-数组

翻译自: https://www.poftut.com/how-to-create-a-drop-down-list-in-excel/

excel创建下拉列表多选