'Time stamp when worksheet was last modified
I have a workbook with several worksheets and I need to separately time-stamp when each sheet was last modified. I found the code below but it gives me when the whole workbook was last modified, as opposed to each individual sheet. I have tried a few variations but couldn't get it to work. Any suggestions on how to do it?
Public Function LastUpdated()
LastUpdated= Format(FileDateTime(ThisWorkbook.FullName), "m/d/yy h:n ampm")
End Function
Solution 1:[1]
Putting the following in the ThisWorkbook object would write the stamp to cell C3 (3rd row, 3rd column)
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.EnableEvents = False
Target.Parent.Cells(3, 3) = Format(Now, "m/d/yy h:n ampm")
Application.EnableEvents = True
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | CLR |
