Time Stamp

R

Richard

I need to have a cell stamped with the currant time. If I
use now() the time changes every time the cell is
recalculated. How can this be done?
 
N

Nick Hodge

You could use the worksheet_change() event. The code below will place the
current date and time in A1 when any change is made in B1

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B1")) Is Nothing Then
Application.EnableEvents = False
Target.Offset(0, -1).Value = Now()
End If
Application.EnableEvents = True
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
 
Top