VBA Code for "Last Created" file saved in same location as workbook

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
582
Office Version
  1. 365
In my folder, I have a tracker, and also a sheet that is saved down manually every hour which feeds and updates the main tracker.

The tracker, is called "Tracker" and the feed in extract, is called "Extract"

I am trying to find a solution to display the date and time it was last updated.

I am wondering if there is a way of referencing the Extract sheet that is saved down, and use the timestamp where it was created to display in a cell.

The cell would need (ideally) to be updated automatically (rather than having to click in and update)

I have found module code that saves the date and time (manually) of the last saved date of the current workbook, and don't know if there is a way of modifying this at all?

VBA Code:
Function LastSavedTimeStamp() As Date
  LastSavedTimeStamp = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
End Function
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Function LastSavedTimeStamp()

LastSavedTimeStamp = FileDateTime(Range("A1").Value)

End Function


Cell A1 should contain the path where the file is saved
C:\Users\username\Documents\Tracker.xslm
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,991
Members
449,094
Latest member
masterms

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