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

  • Thread starter Thread starter mk_garg20
  • Start date Start date
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
 
Hi
is the location of this word 'Total' restricted to a specifc column?
 
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
 

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