VBA 用户窗体数组
目前,我有一个 Excel 电子表格,其中包含一些数据和一个命令按钮,该按钮创建一个显示该数据子集的用户窗体。用户窗体的设计方式使数据更易于查看。我遇到的问题是我希望命令按钮创建用户窗体的多个实例,以便每个窗体可以显示一组不同的数据。
我对 VBA 还很陌生,所以任何建议或只是一个让我入门的地方将不胜感激。谢谢。
Currently, I have an Excel spreadsheet with some data and a command button that creates a UserForm that displays a subset of that data. The UserForm has been designed in a way that makes the data easier to view. The problem that I'm having is that I would like the command button to make multiple instances of my UserForm so that each form can show a different set of data.
I'm pretty new to VBA so any suggestions or just a place for me to get started would be greatly appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保
UserForm
的ShowModal
属性设置为False
,否则只有一个UserForm
实例可以立即显示。之后,就很简单了:
显示
UserForm1
的五个独立副本Make sure that the
ShowModal
property of theUserForm
is set toFalse
as otherwise only one instance of theUserForm
can be shown at once.After that, it is as simple as:
to show five independent copies of
UserForm1