Auto run macro when file is saved

R

Rob

Hi,
Is there a way to auto run a macro everytime a file is saved? I am using the
code below to add a revision date into the footer. I need this to execute
every time the file is saved.
Thanks.

Function MyDate()
Application.Volatile
MyDate = FileDateTime(ThisWorkbook.FullName)
End Function

Sub setfooterfromrange()

With ActiveSheet.PageSetup
ActiveWorkbook.Save
.LeftFooter = "Revision Date: " & Format(Range("z64"), "Dddd, Mmmm dd,
yyyy, h:mm AM/PM")

End With
 

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