Delete a whole row using a macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top