Mike_B
05-17-2016, 08:23 AM
Hi,
I have the below code in my worksheets which reads when a change is made to a cell in column L and outputs the date & time and the username to columns to the right. This works fine, however any time I paste in additional rows or delete a row, I get a runtime 1004 error, highlighting the Target.Offset rows as being problematic.
Any help would be appreciated!
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("L32:L5000")) Is Nothing Then Exit Sub
Target.Offset(0, 5) = Now()
Target.Offset(0, 6) = UserName()
End Sub
I have the below code in my worksheets which reads when a change is made to a cell in column L and outputs the date & time and the username to columns to the right. This works fine, however any time I paste in additional rows or delete a row, I get a runtime 1004 error, highlighting the Target.Offset rows as being problematic.
Any help would be appreciated!
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("L32:L5000")) Is Nothing Then Exit Sub
Target.Offset(0, 5) = Now()
Target.Offset(0, 6) = UserName()
End Sub