Im having problems with the following code. Im planning on using it as part of some userform command button code, but Im separating it out until I can get it working.
I am using the exact same code in my Worksheet Change event code without any issue.
The code should find records from A6 on (to last row in G), and if data exists in G but not in D on the same row, then it should fill it with todays date. If data exists in D but not in G on the same row then D should be cleared.
The code is giving me run time error '424' (Object Required) on this line If Intersect(Target, Range("A6:K"......

Sub Test()
With Sheets("ReturnData")
Dim Rng As Range
If Intersect(Target, Range("A6:K" & Cells(Rows.Count, "G").End(xlUp).Row)) Is Nothing Then Exit Sub
Application.EnableEvents = False
If Not Intersect(Target, Columns("G")) Is Nothing Then
  For Each Rng In Intersect(Target, Columns("G"))
        If Not IsEmpty(Rng) Then
            Rng.Offset(, -3).Value = Date
        Else
            Rng.Offset(, -3).ClearContents
        End If
  Next Rng
End If
Application.EnableEvents = True
End With
End Sub
Thanks,
James