A comprehensive suite of productivity tools and cloud services that enhance collaboration, communication, and efficiency. Combining classic Office apps with advanced Microsoft 365 features, it supports both personal and business needs
Set a reference to "Microsoft Visual Basic for Applications Extensibility" in the VBA editor, then execute the code below. It should be no problem to add a counter, right?
Andreas.
Sub Test()
Dim VBcomp As VBComponent
Dim C As Control
'Visit each component in this file
For Each VBcomp In ThisDocument.VBProject.VBComponents
'What is it?
Select Case VBcomp.Type
Case vbext_ct_MSForm
Debug.Print "Userform: "; VBcomp.Name
'Visit the controls on this form
For Each C In VBcomp.Designer.Controls
Debug.Print " Control: "; C.Name
Next
End Select
Next
End Sub