ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I show the file modification date in a page header? (https://www.excelbanter.com/excel-discussion-misc-queries/201545-how-can-i-show-file-modification-date-page-header.html)

rkriesel

How can I show the file modification date in a page header?
 
How can I show the file modification date and time in a page header or footer?

Gord Dibben

How can I show the file modification date in a page header?
 
You cannot get the "modified date" from an Excel workbook.

There is no "modified date" to grab.

When you open a workbook the modified date changes to current.

If you close the workbook with no changes or save, the modified date will
revert to last modified date which is last saved date.

Open Windows Explorer and find a workbook saved before today and note the
modified date,

Now open that workbook and ViewRefresh in Windows Explorer.

Date will change to current.

Close the workbook without save and ViewRefresh in WE.

Note date changes back to original.

To get last saved date you can use a macro like the following.

Sub printit()
ActiveSheet.PageSetup.RightHeader = "&8Last Saved : " & _
Format(ThisWorkbook.BuiltinDocumentProperties("Las t Save Time"), _
"yyyy-mmm-dd hh:mm:ss")
End Sub


Gord Dibben MS Excel MVP

Gord Dibben MS Excel MVP

On Fri, 5 Sep 2008 14:03:01 -0700, rkriesel
wrote:

How can I show the file modification date and time in a page header or footer?




All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com