Last Saved Date in Footer (right aligned)

C

CherylH

I need for the "last saved date" to appear each time the excel workbook is
SAVED (not necessarily printed). I would like the footer to have the
following literal so that folks reviewing understand this is a "last saved
date" and not a "printed date":
Last Revision Date: <lastrevisiondate>

I'm sure this requires code and I am by no means a coding person! Can
anyone help please?
 
G

Gary''s Student

Just paste the following macro into the ThisWorkbok area:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Format(Now(), "mm/dd/yyy")
End Sub
 
M

Mike H

Cheryl,

Try,

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
With ActiveSheet.PageSetup.RightFooter = "Last saved " & Date
End Sub

Mike
 
M

Mike H

Which should of course be:-
ActiveSheet.PageSetup.RightFooter = "Last saved " & Date
 
C

CherylH

Thank you for the response. One thing: I need to have the literal "Last
Revision Date:" prior to the actual date. How do I modify what you've given
to me for this to occur? Again, thank you!
 
C

CherylH

Hi Mike,
Thanks for the response. Unfortunately I get a compile error - I tried
several times (cut and pasting your info below). Any ideas?
 
M

Mike H

Cheryl,

Alt + F11 to open VB editor
Double click "This Workbook"

From the dropdowns on the right panel select

"Workbook" and in the other dropdown select "Before Save"
Paste the line of code in there

ActiveSheet.PageSetup.RightFooter = "Last saved " & Date

Mike
 
F

Fred Smith

You would change the second line to:

ActiveSheet.PageSetup.RightFooter = "Last Revision Date:" & Format(Now(),
"mm/dd/yyy")
 
C

CherylH

Hey Mike.
Can you tell me how I can also add the time (the time the doc was modified)?
i.e.
Last Saved: 09/05/07 08:42am

Thank you!
 

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