Auto Update Time Stamp?

Leviathan

New Member
Joined
Mar 13, 2018
Messages
4
Hello,

I am trying to have a cell (or cells) that log when the last change was made to a shared workbook.

I have tried a few options through VBA that I found through searching:
Public Function ModDate()​
ModDate = Format(FileDateTime(ActiveWorkbook.FullName), "m/d/yy hh:nn ampm")​
End Function​

or
Sub Last_Save()​
Range("E2").Value = Format(ActiveWorkbook.BuiltinDocumentProperties("Last Save Time"), "m/d/yy hh:nn ampm")​
End Sub​
or
Function LastModified() As Date​
LastModified = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")​
End Function​


Each work, but only each time I run the function. I want this to run automagically whenever there is a change (so that my boss can see how current the workbook data are).

I also tried to force the function to update:
Sub UpdateCell(D2)​
ActiveWorkbook.RefreshAll​
Application.OnTime Now + TimeValue("00:00:5"), "List1.UpdateCell"​
End Sub​




This didn't work at all.

Please help.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Upvote 0
I appreciate the quick reply. I should have noted that I am a complete noob in VBA, so the more elementary the explanation the better.

That said, I'm not opposed to (attempt) learning. In a quick read of the second link, it notes that event procedures don't update on formula calculation. I am only really interested monitoring changes on the summary worksheet that calculates from the other sheets.

So, can I make an event procedure that works on formula calculations somehow? Or can I have it read from the entire workbook?

The formulas I posted above seemed to pull from the workbook's info/properties. I was hoping that I could continue in that direction (tracking last save is accurate enough). I thought/hoped that there was an easy way to make one of the above codes refresh on save.

Does that make sense?
 
Upvote 0
There is a Worksheet_Calculate event, if you want to search/read-up on that.

I am only really interested monitoring changes on the summary worksheet that calculates from the other sheets.
So, that implies that there are changes happening to these other sheets. How exactly are these changes happening?
 
Upvote 0
This is a team project summary workbook. Each team member has a sheet. Each sheet is updated as projects progress. There is a summary page that calculates based on the combined team project progress. My boss wants to look at the summary page and be able to easily tell the last time anyone updated anything. It doesn't need to be member/sheet/project specific, she just wants to know if it has been lying fallow for two weeks.

I thought that would be an easy thing to put in... but nothing is ever easy.
 
Upvote 0
I think I found what I needed.

Adding "Application.Volatile" to the VBA code seems to do the trick.

as in:

[FONT=&quot]Public Function ModDate()[/FONT]
[FONT=&quot] Application.Volatile[/FONT]
[FONT=&quot] ModDate = Format(FileDateTime(ThisWorkbook.FullName), "m/d/yy h:n ampm")[/FONT]
[FONT=&quot]End Function

[/FONT]
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top