Thread: LOCK TIME
View Single Post
  #5   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("A1:A100")) Is Nothing Then
With Target
.Offset(0, 1).Value = Format(Time, "hh:mm:ss")
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

RP
(remove nothere from the email address if mailing direct)


"confused" wrote in message
...
HIYA
how can i lock the time in a cell when using the now function

am developing a vehicle log , and nned it to recored the time a vehicle
arives on site based on when a action is performed

example being
if a2 is activeated then b2 = time
if a3 is activated then b3 = time
ect,

the problem im having is that by using the now function all the times

change
to the last entry time instead of leaving the previous times as they were