File Date Time function


Posted by T-square on December 21, 2001 8:45 AM

I want to put a cell in a spreadsheet that will show the last time it has been modified.

If I use the NOW function, it updates the date and time everytime I open the spreadsheet.

Is there a function that will show the date and time of the last time the spreadsheet has been modified?



Posted by Kevin Mac on December 21, 2001 8:49 AM

Try this, paste this code into your worksheet "code page", you will have to create columns for username, time, and date, and adjust the code accordingly. Good luck
Dim Chged As Range

For Each Chged In Target
If (Chged.Row >= 1 And Chged.Column = 1) Then
If (Chged = "") Then
Chged.Offset(, 1) = ""
Else
Chged.Offset(, 16) = Application.UserName
Chged.Offset(, 17) = XlParamaterDataType & " " & Format(Now(), "hh:mm AM/PM")
Chged.Offset(, 18) = XlParamaterDataType & " " & Format(Now(), "m/d/yyyy")
End If
End If
Next
End Sub