Sub DelRow()
Dim EndRow As Long
For EndRow = Range("A1").End(xlDown).Row To 2 Step -1
If Cells(EndRow, "A").Value = Cells(EndRow - 1, "A").Value Then
If Cells(EndRow, "B").Value < "2" Then
Rows(EndRow).Delete
Else
Rows(EndRow - 1).Delete
End If
End If
Next EndRow
End Sub