insert date

K

kj

Hello,
Excel 2000. How might I insert the document last saved
date into header or footer? Not into a cell.
 
R

Ron de Bruin

You need a sub to do this
This will only work if you are using Excel 2000 or higher

Place this in the thisworkbook module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.SelectedSheets
wkSht.RightFooter = "&8Last Saved : " & _
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
Next wkSht
End Sub

If you use Excel 97 post back
 
R

Ron de Bruin

Oops, not my day

Use this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.SelectedSheets
wkSht.PageSetup.RightFooter = "&8Last Saved : " & _
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
Next wkSht
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