UserForms to deactivate workbook

  • Thread starter Thread starter Patrick Marion
  • Start date Start date
P

Patrick Marion

I have created a UserForm which gives the user the option
to either get into the worksheet/workbook or exit the
worksheet/workbook.

Would someone know the VBA code to attach to the Cancel
button so that it actually closes the workbook?

Thanks very much.
 
ThisWorkbook.Close

or:

ThisWorkbook.Close False 'if you don't want the Save Changes prompt
 
Back
Top