ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Static Date & Time in Footer - Excel 2007 (https://www.excelbanter.com/excel-discussion-misc-queries/217898-static-date-time-footer-excel-2007-a.html)

Maria Maz

Static Date & Time in Footer - Excel 2007
 
Can anyone tell me if I can have a Date and Time generated in the Footer of a
document at the time of creation, and make it static. So if the document
gets passed on and that someone else saves it, I'll still be able to know
when the doc was created.

Thanks!

Gord Dibben

Static Date & Time in Footer - Excel 2007
 
You could just select all sheets then manually enter the date as text in the
footer.

That would remain static but the footer could be changed by users so not
reliable.

Run event code when you save the workbook would overwrite any user changes.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.PageSetup
.LeftFooter = "Date Created " & _
Format(ThisWorkbook.BuiltinDocumentProperties("Cre ation Date"), _
"yyyy-mmm-dd hh:mm:ss")
End With
Next
End Sub

Right-click on the Excel Icon left of "File" or at left end of Title Bar if
window is not maximized and hit "View Code" Copy/paste the above into that
module.

Alt + q to return to Excel then save the workbook.


Gord Dibben MS Excel MVP

On Mon, 26 Jan 2009 07:17:16 -0800, Maria Maz <Maria
wrote:

Can anyone tell me if I can have a Date and Time generated in the Footer of a
document at the time of creation, and make it static. So if the document
gets passed on and that someone else saves it, I'll still be able to know
when the doc was created.

Thanks!




All times are GMT +1. The time now is 07:45 AM.

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