Friday, November 19, 2010

Simple VB Excel Question - How do I find and delete any row that contains the word ';total';?

I've created a macro for Excel in Visual Basic and I need to modify it to find and delete any row that contains the word ';total.';



I also need to make sure the macro doesn't bug out if the word ';total'; doesn't exist on the page.Simple VB Excel Question - How do I find and delete any row that contains the word ';total';?
Sub Delete_Totals()

'

' Delete_Totals Macro

' Macro recorded 12/24/2008

'

On Error GoTo Err

For x = 1 To 100

Cells.Find(What:=';total';, _

After:=Range(';A1';), _

LookIn:=xlFormulas, _

LookAt:=xlPart, _

SearchOrder:=xlByRows, _

SearchDirection:=xlNext, _

MatchCase:=False) _

.EntireRow.Delete

Next

Err:

End SubSimple VB Excel Question - How do I find and delete any row that contains the word ';total';?
I need to see that macro to tell how to modify it the way you want



Enjoy my profile, VBAXLMan is back

No comments:

Post a Comment