ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date last modified macro (https://www.excelbanter.com/excel-programming/346640-date-last-modified-macro.html)

Leon[_5_]

Date last modified macro
 
Hi guys,

I am wondering if there is a function or maro i can write 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. I know that information is in the properties of the
file but i need it to get that info and put it in a cell.

Thanks for the help.


AH·C[_4_]

Date last modified macro
 

In your Microsoft Excel Objects ThisWorkbook, insert this

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Range("A1") = Date 'format your cell to reflect your desired
date/time display
End Sub

Granted this happens only when the wb is saved, if you want it for
anytime a cell is changed, you will have to experiment with other built
in events.

Particularly, you may need to "Dim x as string" to grab the current
value on open and have it reuse that value, in the event that, altho
the wb is saved, no changes were made.

HTH


--
AH·C
------------------------------------------------------------------------
AH·C's Profile: http://www.excelforum.com/member.php...o&userid=29108
View this thread: http://www.excelforum.com/showthread...hreadid=488304


Norman Jones

Date last modified macro
 
Hi Leon,

You also have a response to your post in Excel.


---
Regards,
Norman


"Leon" wrote in message
oups.com...
Hi guys,

I am wondering if there is a function or maro i can write 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. I know that information is in the properties of the
file but i need it to get that info and put it in a cell.

Thanks for the help.




Leon[_5_]

Date last modified macro
 
thanks alot bro ill try it right now


Leon[_5_]

Date last modified macro
 
Thanks



All times are GMT +1. The time now is 02:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com