View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
jindon
 
Posts: n/a
Default Automatic date and time updation


Hi
Paste the code onto sheet module
1) right click on the sheet tab in question and select [ViewCode]
2) paste the code onto the blank space on the right pane
3) click x to close the window and get back to Excel

It will change the time stamp when the data actually changed

Code:
--------------------

Private OldData

Private Sub Sheet_SelectionChange(ByVal Target As Range)
OldData = Target.Value
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
With Target.Cells(1,1)
If .Address(0,0) < "A5" Then Exit Sub
If .Value = OldData Then Exit Sub
Application.EnableEvents = False
.Offset(1).Value = Now
Application.EnableEvents = True
OldData = .Value
End With
End Sub

--------------------


--
jindon
------------------------------------------------------------------------
jindon's Profile: http://www.excelforum.com/member.php...o&userid=13135
View this thread: http://www.excelforum.com/showthread...hreadid=550268