Run a macro upon saving

D

Donnette

Probably a simple one - I am trying to set up a macro to run when the user
saves the file via the save icon. I have the macro set up to generate an
email with the file as an attachment, but would like the macro to run on
save. Thanks.
 
G

Gord Dibben

In Thisworkbook Module.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
macroname or code to run
End Sub


Gord Dibben MS Excel MVP
 

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