Hide Method

Hide method - Hides the userform although it is still loaded in memory so you can still access all the control values.

If for some reason you would like your userform to disappear immediately while its macro is still executing, use the Hide method at the top of the procedure and follow it with a DoEvents command.
For example the following procedure, the Userform disappears immediately when the button is pressed and then the userform eventually unloads once the code has been executed.

Private Sub CommandButton1_Click() 
   For r = 1 to 10000
''do something
   Next r
   Unload Me
End Sub

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext