I have a bunch of rows that I want to delete if the cell D, E, and F are blank. What I have below to identify those row's works just fine but if i try and Delete the Row, it doesn't work completely. How can I rewrite the Else statement to delete the row. I think what is happening is when the row is deleted the count becomes changed.
Dim lastRow As Long, i As Long
lastRow = Cells(Rows.Count, "D").End(xlUp).Row
For i = 2 To lastRow
If Range("D" & i) <> "" And Range("E" & i) <> "" And Range("F" & i) <> "" _
Then Range("A" & i) = "Good" _
Else Range("A" & i) = "Delete" ' If I change this to "Else Range("A" & i).EntireRow.Delete" I don't get all of the cells to delete
Next i
End Sub
Any help anyone can provide would be greatly appreciated.
Dim lastRow As Long, i As Long
lastRow = Cells(Rows.Count, "D").End(xlUp).Row
For i = 2 To lastRow
If Range("D" & i) <> "" And Range("E" & i) <> "" And Range("F" & i) <> "" _
Then Range("A" & i) = "Good" _
Else Range("A" & i) = "Delete" ' If I change this to "Else Range("A" & i).EntireRow.Delete" I don't get all of the cells to delete
Next i
End Sub
Any help anyone can provide would be greatly appreciated.