View Single Post
  #3   Report Post  
Jason Morin
 
Posts: n/a
Default

Sub DeleteRows()
Dim iLastRow As Long
Dim i As Long

Application.ScreenUpdating = False

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
With Cells(i, "A")
If .Value < "" And _
.Offset(0, 1).Value = 0 Then
.EntireRow.Delete
End If
End With
Next i

Application.ScreenUpdating = True

End Sub

---
HTH
Jason
Atlanta, GA

-----Original Message-----
Hi

What code can I use to delete rows based on the values

of
two fields/columns on the same row. (if cell A1 is not
blank and cell B1=0 delete)

Thanks.
.