Hi,
The following code is working as needed on all rows except the first row in range.
As you can see its working from last row to row 9, it will delete all rows that match values in 2 columns and text in another.
This is deleting all rows except row 9 which I thought was included, but row 8 is locked, would that make a difference?
Where am I going wrong?
Sub DeleteFiltered()
Dim r As Long
Dim LastRow As Long
LastRow = Cells(Rows.Count, "H").End(xlUp).Row
For r = LastRow To 9 Step -1
If Cells(r, 8) > -5 And Cells(r, 8) < 0 And Cells(r, 9) = "True " Then
Rows(r).Delete
ElseIf Cells(r, 7) > 0 And Cells(r, 7) < 5 And Cells(r, 9) = "True " Then
Rows(r).Delete
End If
Next r
End Sub
Bookmarks