General discussion

Locked

Last Date Updated Macro

By ljackson.desoto ·
I've got a user who needs to know when the last date of a file was updated (i.e. data changed). I know that properties gives acessed and modified info, but it the file is saved and no changes made the properties will show that file being modified even though the actual data hasn't changed. Any ideas out there?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Last Date Updated Macro

by jboardman In reply to Last Date Updated Macro

Use the properties on the individual fields instead. It add a bit of a load since it will update the record every time a field is changed, but it won't update the date field if nothing is changed.

Collapse -

Last Date Updated Macro

by ljackson.desoto In reply to Last Date Updated Macro

The question was auto-closed by TechRepublic

Collapse -

Last Date Updated Macro

by Charles Byrne In reply to Last Date Updated Macro

Hello,

Open the File you want to monitor Goto the VB editor ALT+F11. In the Project Explorer click on "ThisWorkbook" and insert the follwing code.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

Dim strMsg
strMsg = "Last Changed : " & Format(Now, "mm/dd/yyyy hh:mm am/pm")
strMsg = strMsg & ", Sheet: " & Sh.Name
ThisWorkbook.Names.Add "LastChanged", strMsg

End Sub

In XL Version 5 they used to let you write to the document properties, but it appears to be read only now. That's why I chose to use a workbook name. You could hide the name so that users couldn't modify it. I hope this gets you in the right direction.

Charles

Collapse -

Last Date Updated Macro

by ljackson.desoto In reply to Last Date Updated Macro

The question was auto-closed by TechRepublic

Collapse -

Last Date Updated Macro

by ljackson.desoto In reply to Last Date Updated Macro

This question was auto closed due to inactivity

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums