Writing a macro that will exit a spreadsheet

G

Guest

Hi there.

I am designing a spreadsheet and have various macros running, print, save
etc, allocated to buttons on the sheet. However I would like to have a macro
that also exits the spreadsheet when I run it, unfortunately when I try and
record the macro I exit ok but the macro doesn't record. Any tips please?
 
G

Guest

I'm no expert, still learning the macro stuff myself,.
This has worked for me though... also upon a button_click Command.
this one saves first, then exits.

Sub SaveClose()
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top