Reputation: 15
I wonder why this piece of code returns a type mismatch error whenever the UserForm is initialized:
Private Sub UserForm_Initialize ()
Dim F as MSForms.Frame
For Each F in Me.Controls
F.Visible = False
Next F
End Sub
Upvotes: 1
Views: 71
Reputation: 8531
In support of my comment, something like so
Dim c As Control
For Each c In Me.Controls
If TypeOf c Is Frame Then
c.Visible = True
End If
Next c
Upvotes: 3