Date last modified cell

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.
 
G

goober

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
 
H

Héctor Miguel

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.
 
B

Bob Phillips

And another in worksheet.functions

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
N

Norman Jones

Hi Bob,

LOL.

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

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