Excel用户窗体和相关的组合框

In an Excel UserForm, you can add combo boxes to make data entry easier. The UserForm in this example is used to enter parts information onto a hidden inventory sheet.

Excel UserForm中 ,您可以添加组合框以简化数据输入。 本示例中的UserForm用于将零件信息输入到隐藏的库存表中。

Before selecting a Part ID, you have to select a Part Type. When the Part Type combo box is updated, code runs, and creates a list of parts, for the selected part type.

在选择零件ID之前,您必须选择一个零件类型。 更新“零件类型”组合框后,代码将运行,并为所选零件类型创建零件列表。

dependentcombobox01

这个怎么运作 (How It Works)

In the background, an Advanced Filter runs, to create a worksheet list of parts for the selected part type.

在后台运行“ 高级筛选器” ,以为所选零件类型创建零件的工作表列表。

That list is set up as a named range, and the range name is used as the Part ID combo box row source.

该列表设置为一个命名范围 ,范围名称用作“零件ID”组合框行源。

观看视频 (Watch the Video)

To see how the dependent combo boxes work, watch this short video.

要查看从属组合框的工作方式,请观看此简短视频。

演示地址

下载样本文件 (Download the Sample File)

To test the dependent combo boxes on the UserForm, and to see the code, go to my Contextures website, and download the sample file.

要测试UserForm上的从属组合框并查看代码,请转到我的Contextures网站,然后下载示例文件

翻译自: https://contexturesblog.com/archives/2013/03/07/excel-userform-with-dependent-combo-boxes/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值