Hi,
I am trying to find a macro that will allow me to exit Excel and prompt to save the current workbook and then exit Excel. I want to also assign this to a button.
Thanks
Simon.
Hi,
I am trying to find a macro that will allow me to exit Excel and prompt to save the current workbook and then exit Excel. I want to also assign this to a button.
Thanks
Simon.
Make a commandbutton and if symptomps persist ask the VBAX expert,
[vba]Private Sub CommandButton1_Click()
activeworkbook.close(Yes)
application.quit
End sub
[/vba]
Hi Jammer
Our code posting is a little different from other sites. Select your code and click the VBA button to format it as shown.
Regards
MD
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Originally Posted by mdmackillop
Hi Simon,
Just curious - isn't it quicker just to use the "X" in the top right corner of the Excel window? By default, if you have not saved any open workbook it will prompt you to save, then exit the application.