How do I display the 'Date Modified' in an Excel worksheet header

D

DC Solah

I have a series of workbooks being shared on a business server and being
updated by a number of sources as new information becomes available. Because
the date of these updates is important, I would like the workbook to display
the Date Modified in the header of the document when printed.

The only way I know to see this date is via Excel's properties window (or in
the Details view in Windows).
 
J

Jason Morin

Place this macro in the ThisWorkbook module. The header of the active
worksheet will be the last saved (modified) date:

Private Sub Workbook_BeforePrint(Cancel As Boolean)

Dim LastDate As String
Dim wbProp As String

wbProp = "last save time"
LastDate = ActiveWorkbook.BuiltinDocumentProperties(wbProp)

ActiveSheet.PageSetup.CenterHeader = LastDate

End Sub
 
P

plngarbage

Will this macro show the last date modified of the worksheet in the workbook?
Is there a way to have each tab display the last modified date for that tab
only?
 

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