Hello!
I have the macro below for when a text is written in Col A to register the DateTime in Col B.
If there is a change to the text in Col A, I would like this macro to also record the DateTime of the last change in Col C, keeping the initial DateTime in Col B.
If there is no change in Col A, Col C will be empty.
Thanks in advance.
anvs
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRg As Range
Dim xCell As Range
Set xRg = Intersect(Target, Range("A:A"))
If Not xRg Is Nothing Then
On Error GoTo SafeExit
Application.EnableEvents = False
For Each xCell In xRg
Select Case True
Case VBA.IsEmpty(xCell.Offset(0, 1).Value)
xCell.Offset(0, 1).Value = Now
End Select
Next
End If
SafeExit:
Application.EnableEvents = True
End Sub
I have the macro below for when a text is written in Col A to register the DateTime in Col B.
If there is a change to the text in Col A, I would like this macro to also record the DateTime of the last change in Col C, keeping the initial DateTime in Col B.
If there is no change in Col A, Col C will be empty.
Thanks in advance.
anvs
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRg As Range
Dim xCell As Range
Set xRg = Intersect(Target, Range("A:A"))
If Not xRg Is Nothing Then
On Error GoTo SafeExit
Application.EnableEvents = False
For Each xCell In xRg
Select Case True
Case VBA.IsEmpty(xCell.Offset(0, 1).Value)
xCell.Offset(0, 1).Value = Now
End Select
Next
End If
SafeExit:
Application.EnableEvents = True
End Sub