jim may
Well-known Member
- Joined
- Jul 4, 2004
- Messages
- 7,486
I'm trying to Move a Row of Data to ANOTHER WORKSHEET (Same WB) if Column 8 of each row included the text "closed". Once the First such row is Cut and Deleted the code is taking me to Sheet2 but bombing after running the code line IN RED (below). Current getting the 1004 error. What's missing/wrong? TIA, Jim
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Columns(8), Target) Is Nothing Then Exit Sub
Dim i As Long
Application.EnableEvents = False
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
If Cells(i, 8).Value = "closed" Then
Cells(i, 8).EntireRow.Cut
Cells(i, 8).EntireRow.Delete
With Worksheets("Sheet2")
NBR = .Range("A" & Rows.Count).End(xlUp).Row + 1
.Range("A" & NBR).PasteSpecial Paste:=xlPasteValues
End With
End If
Next i
Application.EnableEvents = True
End Sub