bradyboyy88
Well-known Member
- Joined
- Feb 25, 2015
- Messages
- 562
Hi,
I am curious if there is a way to loop through all control objects in a userform frame or do I have to loop through all objects in the userform and look for that particular frame as a parent? For instance, can I use a for each item in frame type loop?
My Current code draws a mistype error:
I am curious if there is a way to loop through all control objects in a userform frame or do I have to loop through all objects in the userform and look for that particular frame as a parent? For instance, can I use a for each item in frame type loop?
My Current code draws a mistype error:
Code:
[COLOR=#333333]
Option Explicit
Public Sub Weekly_Button()
HideAllSubFrames (Userform1.TestFrame)
End Sub
Public Sub HideAllSubFrames(ParentFrame As MSForms.FRAME)
Dim ObjectList As Variant
For Each ObjectList In ParentFrame.Controls
If TypeName(ObjectList.Type) = "Frame" Then
ObjectList.Visible = False
End If
Next
End Sub[/COLOR]
Last edited by a moderator: