ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search "Total" in all worksheets and delete rows containing "Total" (https://www.excelbanter.com/excel-programming/305525-search-total-all-worksheets-delete-rows-containing-total.html)

mk_garg20

Search "Total" in all worksheets and delete rows containing "Total"
 
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

--
Message posted from http://www.ExcelForum.com


Frank Kabel

Search "Total" in all worksheets and delete rows containing "Total"
 
Hi
is the location of this word 'Total' restricted to a specifc column?

--
Regards
Frank Kabel
Frankfurt, Germany


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
Manoj


---
Message posted from http://www.ExcelForum.com/


Stan Scott

Search "Total" in all worksheets and delete rows containing "Total"
 
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

"mk_garg20 " wrote in message
...
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
Manoj


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 10:59 AM.

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