1

I'm using the following VBA to act as a timestamp to track speaking time in meetings by individuals (e.g. typing in initials to the target.column and then collecting data based on time elapsed from start time to end time). However, sometimes there are errors made when typing the initials which need to be corrected after the fact. Correcting these restarts the timestamp, thus requiring manual correction of the timestamps. Is there a way to edit the target.column without triggering the timestamp?

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.column = 12 And Target.Row = 9 Then
        If Target.Value = "" Then
            Target.Offset(0, 4).Value = ""
        Else
            Target.Offset(0, 4).Value = Format(Now, "mm/dd/yyyy HH:mm:ss")
        End If
    ElseIf Target.column = 12 And (Target.Row >= 10 And Target.Row <= 600) Then
        If Target.Value = "" Then
            Target.Offset(-1, 5).Value = ""
        Else
            Target.Offset(-1, 5).Value = Format(Now, "mm/dd/yyyy HH:mm:ss")
        End If
    End If
End Sub
GSerg
  • 76,472
  • 17
  • 159
  • 346
bondo455
  • 21
  • 1
  • 2
    Capture the [value before edit](http://stackoverflow.com/q/4668410/11683). If it's not empty and the new value is not empty, do not update the timestamp. – GSerg Sep 27 '16 at 18:54

0 Answers0