I'm trying to get my userform to hide all controls when it opens (Userform_Initialize) EXCEPT for those within a frame.
Unfortunately, this doesn't work:
Nor does this (no error when I replace the line of code with this code, but it still remains hidden):
The controls inside Frame1 remain hidden.. The code hides all the controls regardless of whether its in Frame1 or not...... ?
Thanks in advance for any help.
Unfortunately, this doesn't work:
VBA Code:
For Each ctl In Me.Controls
ctl.Visible = False
If TypeName(ctl) = "Frame1" Then ctl.Visible = True
Next ctl
Nor does this (no error when I replace the line of code with this code, but it still remains hidden):
VBA Code:
If TypeName(ctl) = "Frame1" Then ctl.Frame1.Visible = True
The controls inside Frame1 remain hidden.. The code hides all the controls regardless of whether its in Frame1 or not...... ?
Thanks in advance for any help.