ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   MULTIPLE DATE/TIME stamp (https://www.excelbanter.com/excel-worksheet-functions/141757-multiple-date-time-stamp.html)

Ruben

MULTIPLE DATE/TIME stamp
 
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.

JMB

MULTIPLE DATE/TIME stamp
 
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

"ruben" wrote:

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.


JMB

MULTIPLE DATE/TIME stamp
 
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

"JMB" wrote:

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

"ruben" wrote:

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.


Ruben

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


All times are GMT +1. The time now is 02:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com