Search "Total" in all worksheets and delete rows containing "Total"

M

mk_garg20

Hello All,
I am new to VBA programming.

I have many worksheets in my excel file.
I want to serach "Total" keyword in all worksheets.
Then delete all the rows containing "Total" Keyword.

Please help me.

Thanks
Mano
 
S

Stan Scott

Manoj,

This should take care of it for you:

Sub RemoveTotalRows()
For Each tSheet In ActiveWorkbook.Worksheets
Set myTotal = tSheet.Cells.Find("Total")
Do Until myTotal Is Nothing
myTotal.EntireRow.Delete
Set myTotal = tSheet.Cells.Find("Total")
Loop
Next
End Sub

Stan Scott
New York City
 
Top