View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default UserForms to deactivate workbook

ThisWorkbook.Close

or:

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

--

Vasant


"Patrick Marion" wrote in message
...
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.