Last Modified time...

D

Dennis

I have an excel spreadsheet that needs to keep track of
the last time another spreadsheet was saved / modified.
Is there a formula that does this?
 
M

merlin

Dennis said:
I have an excel spreadsheet that needs to keep track of
the last time another spreadsheet was saved / modified.
Is there a formula that does this?

Public Function trackFile(strFile As String) As Date
Dim fso, fs, d As Date
Set fso = CreateObject("Scripting.FileSystemObject")
Set fs = fso.GetFile(strFile)
d = fs.DateLastModified
trackFile = d
End Function

Place this function in a Module. Then in your worksheet, enter:
=trackFile("C:\bogus.txt")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top