Last Mod Date

G

GWB

I would like to update a cell with the "Last-Modified" date so that when I
load the spreadsheet, the last time I changed it shows. Whats the best way
to access that?

Thanks
 
R

Ron de Bruin

You can use this in the thiswoorkbook module

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
'If you save the file the date/time will be placed in cell A1 of Sheet1
Sheets("Sheet1").Range("A1").Value = Format(Now, "yyyy-mmm-dd hh:mm:ss")
End Sub
 
R

Rick Rothstein \(MVP - VB\)

I'm guessing this would work....

Private Sub Workbook_Open()
Worksheets("Sheet1").Range("A1").Value = _
FileDateTime(ThisWorkbook.Path & "\" & ThisWorkbook.Name)
End Sub

Change the worksheet and cell references to match your actual conditions.

Rick
 

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