find and delete row

  • Thread starter Thread starter vikram
  • Start date Start date
V

vikram

Hi

Can we have a macro which finds something and deletes that entire ro
and that too like 3 or more criterias:

like if it finds "------" and "manual" and "blank" and so on

a macro with multiple criteria option, like all at one go

thank u so much frnd
 
Hi
try something like the following (looks in column A):
Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
with Cells(RowNdx, "A")
if .value = "" or .value = "------" _
or .value = "manual" then
Rows(RowNdx).Delete
End If
end with
Next RowNdx
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