View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AH·C[_4_] AH·C[_4_] is offline
external usenet poster
 
Posts: 1
Default 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