Deleting rows in Excel based on criteria

  • Thread starter Thread starter SteveM
  • Start date Start date
S

SteveM

Is it possible to automate the deletion of row based on a
criteria, preferably through a macro? i.e. - run the
macro and delete any row who has "NO" in last column.
 
and delete any row who has "NO" in last column.

last column IV ??
 
I'm not sure what you mean...

I need to delete an entire row from the worksheet if it
meets a criteria that I set, i.e. any row that has the
value "Joe" in column E would be deleted from the sheet....

Thanks
-----Original Message-----

last column IV ??

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)




"SteveM" <[email protected]> wrote in
message news:[email protected]...
 
value "Joe" in column E
Now I know the column

Example for Sheet1

Sub Test()
Dim r As Long
Application.ScreenUpdating = False
With Worksheets("Sheet1")
For r = .UsedRange.Rows.Count To 1 Step -1
If .Cells(r, "E").Value = "Joe" Then .Rows(r).Delete
Next
End With
Application.ScreenUpdating = True
End Sub
 

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