ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP! (https://www.excelbanter.com/excel-programming/294233-help.html)

Salman Shoaib

HELP!
 
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

AA2e72E[_2_]

HELP!
 
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


All times are GMT +1. The time now is 09:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com