Delete a whole row using a macro

L

LaurenceL

I am trying to set a macro up in Excel so that it will check a value in
column A and if the value equals 'abc' (or whatever other value), I want to
delete the row all together.
I haven't used VB in a long time, and I don't know how to get started... Any
help will be greatly appreciated.

Thank you
 
B

Bob Phillips

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = cLastRow to 1 Step -1
If Cells(i,"A").Value =, "abc" Then
Cells(i,"A").EntireRow.Delete
End If
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top