ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Close Form with VBA (https://www.excelbanter.com/excel-programming/275705-close-form-vba.html)

William C. Smith

Close Form with VBA
 
Is there a VBA command that will close a userform, the equivalent of the
user clicking the close button on the form title line?

Patrick Molloy[_4_]

Close Form with VBA
 
Unload userformname

or

on the form's code page
Unload Me

--
Patrick Molloy
Microsoft Excel MVP
----------------------------------
"William C. Smith" <wcsmithx*xieee.org wrote in message
.. .
Is there a VBA command that will close a userform, the equivalent of the
user clicking the close button on the form title line?




Bradley Dawson

Close Form with VBA
 
You may also want to try the Hide method. It keeps the form in memory, so
entries do not get erased, but removes the form from view.

UserForm1.Hide

"William C. Smith" <wcsmithx*xieee.org wrote in message
.. .
Is there a VBA command that will close a userform, the equivalent of the
user clicking the close button on the form title line?




William C. Smith

Close Form with VBA
 
"Patrick Molloy" wrote in news:#QMUmaybDHA.2932
@tk2msftngp13.phx.gbl:

Thanks for the help. Unload userformname works fine. I did not try Unload
Me on the form's code page, but I could not find any reference to Unload Me
in VBA help.

Again, thanks.

Unload userformname

or

on the form's code page
Unload Me




All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com