需要在 VBA 的用户窗体中显示一个下拉菜单。要显示的数据存储在表格中的表格中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11606136/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
need to display a drop down menu in the userform in VBA. The data to be displayed is stored in a table in a sheet
提问by Rachit
I have a table, stored in a worksheet. I need to display the data of this table (only the first column) in a listbox in a User-form. Can anyone suggest me a way to do it ??? Thanks in advance . :)
我有一张表,存储在工作表中。我需要在用户表单的列表框中显示此表的数据(仅第一列)。任何人都可以建议我一种方法吗???提前致谢 。:)
采纳答案by Bill Stidham
Focused on your combo box in the form designer by clicking on it, then look for a property in the properties explorer named 'row source'. Supply an appropriate cell range , e.g. Sheet2!A1:A20, or A:A for the entire A column, ....
通过单击将焦点放在表单设计器中的组合框上,然后在属性资源管理器中查找名为“行源”的属性。为整个 A 列提供适当的单元格范围,例如 Sheet2!A1:A20 或 A:A,...。