SeniorNewbie
Board Regular
- Joined
- Jul 9, 2023
- Messages
- 77
- Office Version
- 2021
- 2019
- Platform
- Windows
- MacOS
Hi out there!
I'm playing around with userforms and controls. With this:
I get all existing userfroms of a workbook. My next step ist to write some details of the included controls to a sheet (this part works). Now I want to handover the usf.name in a loop to the next sub. I tried objects, msForms.Userform, strings and variants.
How can I do this?
THX a lot
I'm playing around with userforms and controls. With this:
VBA Code:
Sub GetUserForms()
Dim usf As Object, sUSF As String
For Each usf In ThisWorkbook.VBProject.VBComponents
If usf.Type = 3 And Left(usf.Name, 3) <> "the" Then
sUSF = usf.Name
MsgBox sUSF, , "1: "
test sUSF
End If
Next
End Sub
Sub test(sUSF As String)
MsgBox sUSF, , "2: "
Dim oUSF As Object
Set oUSF = sUSF
MsgBox oUSF.Caption, , "2:: "
End Sub
How can I do this?
THX a lot