使用 VBA 在 Excel 中动态生成表单
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/535913/
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
Dynamic generation of Forms in Excel using VBA
提问by Mitch Wheat
I'm trying to find or develop some VBA to dynamically generate form fields (labels and textboxes).
我正在尝试查找或开发一些 VBA 来动态生成表单字段(标签和文本框)。
The source data is a table on a hidden Excel worksheet.
源数据是隐藏的 Excel 工作表上的表格。
Any ideas?
有任何想法吗?
回答by Mitch Wheat
You can generate new items in the Forms Controls collection by using the Add method specifying the type of control using its CLSID.
您可以使用 Add 方法在 Forms Controls 集合中生成新项目,该方法使用控件的 CLSID 指定控件的类型。
This article Dynamic Excel Forms using VBAhas some example code.
本文使用 VBA 的动态 Excel 表单有一些示例代码。