Need Help Please
Board Regular
- Joined
- Jul 7, 2009
- Messages
- 64
I have a macro that works and find the word total in a spreadsheet and deletes the entire row. I also would like to delete other rows like Grand Total and Account Name. Can someone tell me how to add an input box to this code or modify the code so it can ask for a word then delete all rows that have that word in it. Thanks in advance!!!
Here is the code:
Here is the code:
Code:
Sub DeleteRows()
Dim rFound As Range, Str As String
Application.ScreenUpdating = True
On Error Resume Next
Str = "total"
Do
Set rFound = Cells.Find(Str, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows)
If Not rFound Is Nothing Then Rows(rFound.Row).EntireRow.Delete xlShiftUp
Loop Until rFound Is Nothing
Application.ScreenUpdating = True
End Sub