vba combobox添加下拉内容
时间: 2023-04-26 11:06:25
浏览: 564

VBCombox实现下拉

在 VBA 中,可以使用以下方法来向 [combobox](https://wenku.csdn.net/doc/6412b676be7fbd1778d46cfb?spm=1055.2569.3001.10083) 添加下拉内容:
1. 使用 AddItem 方法:
ComboBox1.AddItem "选项 1"
ComboBox1.AddItem "选项 2"
ComboBox1.AddItem "选项 3"
2. 使用 List 数组:
ComboBox1.List = [array](https://wenku.csdn.net/doc/6412b777be7fbd1778d4a671?spm=1055.2569.3001.10083)("选项 1", "选项 2", "选项 3")
3. 使用 ListFill[range](https://wenku.csdn.net/doc/2exi652bnr?spm=1055.2569.3001.10083) 属性:
在 [excel](https://wenku.csdn.net/doc/640n8f90vm?spm=1055.2569.3001.10083) 表格中建立一个名为 "MyList" 的范围,并在其中填入要显示的选项。然后将 ComboBox1 的 ListFillRange 属性设置为 "MyList"。
记得每次添加前要清空原先的内容,如:
ComboBox1.Clear
阅读全文
相关推荐
















