Last Modified date??

MarkyD

New Member
Joined
Feb 27, 2002
Messages
3
I require the date to appear on a document, that shows the date the document was last saved AFTER BEING MODIFIED. The document contains many VB macro's that control printing and viewing (Therefore making changes to format etc, and manually calculating). This causes "=today()" to change when the document is viewed, but not modified.
This message was edited by MarkyD on 2002-03-06 00:22
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
A Quick solution might be

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Range("A1").Value = Today()

End Sub
 
Upvote 0
On 2002-03-06 00:20, MarkyD wrote:
I require the date to appear on a document, that shows the date the document was last saved AFTER BEING MODIFIED. The document contains many VB macro's that control printing and viewing (Therefore making changes to format etc, and manually calculating). This causes "=today()" to change when the document is viewed, but not modified.
This message was edited by MarkyD on 2002-03-06 00:22


'This UDF may help

Function FileLastMod() As String
Dim FileDate As Double

On Error Resume Next
FileDate = FileDateTime(ThisWorkbook.FullName)
If Err.Number = 0 Then
FileLastMod = Format(FileDate, "dd/mm/yy hh:mm:ss")
Else
FileLastMod = "Error"
End If
End Function


'Place in a Module and call from worksheet as follows

'=FileLastMod("D:Xl_usefulFiledateFunction.xls")


HTH

Ivan
 
Upvote 0

Forum statistics

Threads
1,223,382
Messages
6,171,767
Members
452,422
Latest member
rlynchbro

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