ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Last Modified Date (https://www.excelbanter.com/excel-programming/389960-last-modified-date.html)

Me

Last Modified Date
 
Can I put the last modified time and date into a header in Excel 2003?

If so, how would I do that?

Thank you in advance.

Vergel Adriano

Last Modified Date
 
The code below is for the Before_Save event of the workbook. It will put the
current date and time on the right side of the header for all sheets in the
workbook.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim sht As Worksheet
For Each sht In Sheets
sht.PageSetup.RightHeader = "Last Modified On " & Now
Next sht
End Sub


--
Hope that helps.

Vergel Adriano


"Me" wrote:

Can I put the last modified time and date into a header in Excel 2003?

If so, how would I do that?

Thank you in advance.


Jim Jackson

Last Modified Date
 
Sub TEST()
s = "H:\Projects\Projects.xls"
dt = FileDateTime(s)
With ActiveSheet.PageSetup
.CenterHeader = dt
End With

End Sub
--
Best wishes,

Jim


"Me" wrote:

Can I put the last modified time and date into a header in Excel 2003?

If so, how would I do that?

Thank you in advance.



All times are GMT +1. The time now is 04:41 PM.

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