The macro works great with 'ClearContents', however, I can't clear the whole line because there are formulas in some cells, anymore suggestions?
Thanks!
Ryan,
I tried the macro, but it did not work, I checked the code very carefully and found no mistakes, did I miss something?
Julie
Hi Julie,
Here is some code that will take care of your problem. It searchs for the key word and deletes the whole row that has the word in it. It keeps looping until there are no more. Where it says "InsertWordHere", replace this with your "key word." Hope it's what you need. Let me know.
Ryan
Sub SearchAndDelete()
Dim Row As Integer
On Error GoTo ErrHandler
Application.ScreenUpdating = False
Do
Row = Cells.Find(What:="InsertWordHere", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False).Row
Rows(Row).Delete Shift:=xlUp
Loop
ErrHandler:
Application.ScreenUpdating = True
Exit Sub
End Sub
The macro worked great - once I figured out that 'xl' NOT 'x1' Silly me, but I still net to ClearContents and not delete the ROW.
Thanks