Date Last Modified Function

L

Leon

Hi guys,

I am wondering if there is a function 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.
 
B

Bob Phillips

You would need to build that yourself, with VBA

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
With ThisWorkbook
.Names.Add Name:="___ChangeTime", RefersTo:=Now
.Names("___ChangeTime").Visible = False
End With
End Sub


You can access on a worksheet with this UDF

Function DateChanged()
Application.Volatile
DateChanged = Evaluate(Parent.Parent.Names("___ChangeTime").RefersTo)
End Function


--

HTH

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

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