MULTIPLE DATE/TIME stamp

R

ruben

working on a log sheet which has column A for date/time IN and a column G for
date/time out. I will like column A to get stamped upon filling out column D
(locaction) and column G stamped when column E task is indicated. Is the
possible, been working on this for 2 days and I need some help, please
somebody.
 
J

JMB

Try this - right click on the sheet tab, select view code, and paste this
into the code window that appears.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

If Target.Column = 4 Then
Range("A" & Target.Row).Value = Now
ElseIf Target.Column = 5 Then
Range("G" & Target.Row).Value = Now
End If

Application.EnableEvents = True

End Sub
 
J

JMB

Added a line so that that it will not overwrite the date/time stamp if
something is deleted from column D or E.

Private Sub Worksheet_Change(ByVal Target As Range)
If Len(Target.Value) = 0 Then Exit Sub
Application.EnableEvents = False

If Target.Column = 4 Then
Range("A" & Target.Row).Value = Now
ElseIf Target.Column = 5 Then
Range("G" & Target.Row).Value = Now
End If

Application.EnableEvents = True

End Sub
 
R

ruben

thank, I'll give a shot. I had DATE/TIME IN figured out, but the DATE/TIME
OUT was given a problem. Again thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top