Morning/Afternoon all,
I have this code that when column B is populated column A will be populated with the time and date,
it works great but only on one entry if i try to paste to multiple cells in column B it does not add the time and date to each adjacent cell in column A,
Might any of the professionals amongst you have an answer to this issue thanks in advance and i am very new to VBA i appreciate the help.
I have this code that when column B is populated column A will be populated with the time and date,
it works great but only on one entry if i try to paste to multiple cells in column B it does not add the time and date to each adjacent cell in column A,
Might any of the professionals amongst you have an answer to this issue thanks in advance and i am very new to VBA i appreciate the help.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'Updated by Extendoffice 2017/10/12
Dim xRg As Range, xCell As Range
On Error Resume Next
If (Target.Count = 1) Then
If (Not Application.Intersect(Target, Me.Range("B:B")) Is Nothing) Then _
Target.Offset(0, -1) = Format(Now(), "yyyy-MM-dd hh:mm:ss")
Application.EnableEvents = False
Set xRg = Application.Intersect(Target.Dependents, Me.Range("B:B"))
If (Not xRg Is Nothing) Then
For Each xCell In xRg
xCell.Offset(0, -1) = Format(Now(), "yyyy-MM-dd hh:mm:ss")
Next
End If
Application.EnableEvents = True
End If
End Sub