I have the following code
Instead of searching Column "A" for the last row in "Closed Projects" (as it is an optional field) I want to use Column "C". When I changed the "A" to "C," the code no longer updates on change event....it doesn't copy and paste the row and does not delete the target row, no error messages, no debug.
I've manually triggered the error handler to make sure EnableEvents= True...still no luck. I don't understand much about the intersect/target method so I'm not sure what I am missing.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
If Not Intersect(Target, Range("H:H")) Is Nothing Then
If Target.Cells.Count > 1 Or IsEmpty(Target) Then GoTo errHandler
On Error GoTo errHandler
If Target = "Closed" Then
Target.EntireRow.Copy Sheets("Closed Projects").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
End If
End If
errHandler:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Instead of searching Column "A" for the last row in "Closed Projects" (as it is an optional field) I want to use Column "C". When I changed the "A" to "C," the code no longer updates on change event....it doesn't copy and paste the row and does not delete the target row, no error messages, no debug.
I've manually triggered the error handler to make sure EnableEvents= True...still no luck. I don't understand much about the intersect/target method so I'm not sure what I am missing.