Date last modified cell

  • Thread starter Thread starter Leon
  • Start date Start date
L

Leon

Hi guys,

I am wondering if there is a function or vba script in excel that can
show the date my .xls fle was last modified?

So i need it to only change when any cells are changed with in the
workbook but if the workbook is opened and just viewed at, the date
will not change.

Thanks for the help.
 
from Excel Help

DateLastModified Property


Description

Returns the date and time that the specified file or folder was last
modified. Read-only.

Syntax

object.DateLastModified

The object is always a File or Folder object.

Remarks

The following code illustrates the use of the DateLastModified property
with a file:

Sub ShowFileAccessInfo(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = UCase(filespec) & vbCrLf
s = s & "Created: " & f.DateCreated & vbCrLf
s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf
s = s & "Last Modified: " & f.DateLastModified
MsgBox s, 0, "File Access Info"
End Sub
 
hi !

just to remark that (filespec) *must be* a closed file
if OP's .xls is an opened workbook... see: http://tinyurl.com/8zuwd
also, if OP needs to track changes in wb' cells *only* from the last *real* save...
try the excel4 macro-funciton: Get.Document(4)

hth,
hector.
 
And another in worksheet.functions

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Hi Bob,

LOL.

At least I avoided triangularity - I ignored the Worksheet functions post!
 
Back
Top