ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find the word "total" in a cell, delete row or column (https://www.excelbanter.com/excel-programming/314133-find-word-total-cell-delete-row-column.html)

Lawlerd[_2_]

Find the word "total" in a cell, delete row or column
 

Thanks Ste,
I did see this post. My problem is a bit more complicated by the fac
that the text "Total" could be in any column, and may or may not b
surrounded by other text, like "2 total", or "total 5", or may be i
mixed case "Total". I tried changing the code to "*total*" hoping the
would act as a wild card before or after the text...Didn't seem to work
If anyone else has time to help I'd appreciate it. Thanks again.
:rolleyes

--
Lawler
-----------------------------------------------------------------------
Lawlerd's Profile: http://www.excelforum.com/member.php...fo&userid=1547
View this thread: http://www.excelforum.com/showthread.php?threadid=27057


Tom Ogilvy

Find the word "total" in a cell, delete row or column
 
Sub Macro1()
Set rng = Cells.Find("total", LookIn:=xlValues, LookAt:=xlPart)
Do While Not rng Is Nothing
rng.EntireRow.Delete
Set rng = Cells.FindNext(Range("A65536"))
Loop

End Sub

--
Regards,
Tom Ogilvy



"Lawlerd" wrote in message
...

Thanks Ste,
I did see this post. My problem is a bit more complicated by the fact
that the text "Total" could be in any column, and may or may not be
surrounded by other text, like "2 total", or "total 5", or may be in
mixed case "Total". I tried changing the code to "*total*" hoping the *
would act as a wild card before or after the text...Didn't seem to work.
If anyone else has time to help I'd appreciate it. Thanks again.
:rolleyes:


--
Lawlerd
------------------------------------------------------------------------
Lawlerd's Profile:

http://www.excelforum.com/member.php...o&userid=15473
View this thread: http://www.excelforum.com/showthread...hreadid=270570





All times are GMT +1. The time now is 12:12 PM.

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