浏览工作簿的所有用户表单 [英] Go through all the userforms of a workbook
本文介绍了浏览工作簿的所有用户表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想编写一个VBA程序,该程序在工作簿中打印所有用户表单的名称.
I would like to write a VBA program that prints the name of all the userforms in a workbook.
例如,如果工作簿具有名为 frmHello
的用户表单.我只想打印 UserForm:frmHello
For instance, if a workbook has a userform called frmHello
. I just want to print UserForm: frmHello
有人知道哪个集合与用户表单有关,以及如何查找用户表单的名称吗?
Does anyone know which collection is about userforms, and how to find the name of a userform?
推荐答案
这个对我有用:
Dim c As Object
For Each c In ThisWorkbook.VBProject.VBComponents
If c.Type = 3 Then
MsgBox c.Name
End If
Next
这篇关于浏览工作簿的所有用户表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文