ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   exit form and close sheet (https://www.excelbanter.com/excel-programming/429008-re-exit-form-close-sheet.html)

Sam Wilson

exit form and close sheet
 
Declare a public boolean variable and set it to false in your code before you
show the form.

Include a line setting the value of this variable to True when OK is clicked

back in the code that called the form, include a line to close the sheet if
the boolean variable is false.

"Doug" wrote:

I have a command button on a form that checks a password, if OK, it opens a
sheet. If I use the X on the top corner to close the form it opens the sheet
without checking the password. How do I close the sheet if the form is
exited. Thanks for the help.



All times are GMT +1. The time now is 08:37 AM.

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