Microsoft Office Tutorials and References
In Depth Information
Hiding a UserForm
Double-click the selected control
to quickly access its Click event
in the UserForm’s module.
figurE 18-18
When you double-click the CommandButton, you will see these lines of code in the UserForm’s
Private Sub CommandButton2_Click()
End Sub
To complete the Click procedure, type Unload Me . When the Cancel button is clicked, the
UserForm will unload — that is, it will close and release from memory the data that was entered —
with this Click event for that button:
Private Sub CommandButton2_Click()
Unload Me
End Sub
Hiding a userform
The Hide method makes the UserForm invisible, but the data that was in the UserForm is still there,
remaining in memory and able to be viewed when the form is shown again. In some situations you
will want this to be the case, such as if you are interacting with two or more UserForms and you
want the user to focus on only one form at a time. The statement to hide a UserForm is Me.Hide .
Search JabSto ::

Custom Search