Thread: date
View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A:A")) Is Nothing Then
With Target
.Offset(0, 1).Value = Format(Date, "dd mmm yyyy")
.Offset(0, 2).Value = Format(Time, "h")
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 on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
HTH

Bob Phillips

"daolb" wrote in
message ...

If have three columns. One which reflect the status of the record.
OK/NOK.
Every time I change the status, excel has to adapt the date and hour in
respectively column 2 and 3.
which formula do I have to use?
note that only the date of the changed record may be adapted, and not
date of the other records.

thanks in advance.
david


--
daolb
------------------------------------------------------------------------
daolb's Profile:

http://www.excelforum.com/member.php...o&userid=24478
View this thread: http://www.excelforum.com/showthread...hreadid=380794