HELP!

  • Thread starter Thread starter Salman Shoaib
  • Start date Start date
S

Salman Shoaib

I'm trying to make a macro that will find "-+-", then delete the
entire row and do this process again & again until all the rows with
"-+-" are deleted in the worksheet.

I managed to make a macro that will do the find & delete ONCE but I
don't know how to make the macro keep going in a loop until it can't
find anymore.

Can anyone help me please?

Thanx
 
Try this

Sub Macro1(
Range("A1").Select ' Right at the to
While Err.Number =
On Error GoTo L
ActiveSheet.Cells.Find(What:="-+-", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
.Activat
ActiveSheet.Rows(Selection.Row).Delet
Wen
L0: Exit Su
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