excel下拉列表联动_国家和城市的Excel下拉列表

本文介绍了如何在Excel中创建联动的下拉列表,使得在选择国家后,对应的城市列表会自动更新。内容包括如何设置数据验证、使用INDIRECT函数以及获取示例文件的途径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

excel下拉列表联动

In Excel, you can use data validation to create drop down lists on a worksheet. Usually, a simple list is all that's needed, to make it easier for people to enter the correct data. This example is a bit more complicated, and has 2 drop down lists, one for country and one for city.

在Excel中,您可以使用数据验证在工作表上创建下拉列表。 通常,只需要一个简单的列表,以使人们更容易输入正确的数据。 这个例子有点复杂,有2个下拉列表,一个用于国家,一个用于城市。

相关下拉列表 (Dependent Drop Downs Lists)

In this example, there are dependent drop down lists:

在此示例中,有相关的下拉列表

  • Select a country in column A

    在A列中选择一个国家
  • In column B, the drop down list shows cities from the country selected in that row

    在B列中,下拉列表显示该行中所选国家/地区的城市
Excel Drop Down Lists for Country and City

请参阅如何设置列表 (See How to Set Up the Lists)

In this video, you can see how to set up the lists for the data validation. Then, see how to use the INDIRECT function in the data validation rule, to show the correct city list, depending on the selected country.

在此视频中,您可以看到如何设置数据验证列表。 然后,查看如何在数据验证规则中使用INDIRECT函数 ,以显示正确的城市列表,具体取决于所选的国家/地区。

演示地址

获取样本文件 (Get a Sample File)

If you prefer written instructions for setting up dependent drop down lists, go to the Dependent Data Validation page on my Contextures website.

如果您希望使用书面说明来设置相关的下拉列表,请转到Contextures网站上的“ 相关数据验证”页面

On that page, you'll find another example of this technique, with step by step details, and screen shots to show the steps.

在该页面上,您将找到该技术的另一个示例,其中包含逐步的详细信息,以及显示步骤的屏幕截图。

There is a sample file on that page too, so you can see how the dependent drop down lists work.

该页面上也有一个示例文件,因此您可以查看从属下拉列表的工作方式。

翻译自: https://contexturesblog.com/archives/2011/09/02/excel-drop-down-lists-for-country-and-city/

excel下拉列表联动

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值