Date when

M

Matt

Is there a way to have excel automatically update the date that a
particular action was performed?

For example, if my sheet looks like this:

Number Date
1 2/16/07

and then on 2/17/07, if I change 1 to 6, the date will automatically
change to 2/17/06.

Thanks for any ideas!
 
B

Bob Phillips

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target.Offset(0, 1)
.NumberFormat = "dd mmm yyyy"
.Value = Date
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Top