Here is my current Macro:
Sub DeleteRows()
Dim rng As Range
Do
If Not rng Is Nothing Then
rng.EntireRow.Delete
End If
Set rng = Cells.Find(What:="arbys", _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
Loop While Not rng Is Nothing
Do
If Not rng Is Nothing Then
rng.EntireRow.Delete
End If
Set rng = Cells.Find(What:="bagel", _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
Loop While Not rng Is Nothing
End Sub
Currently it deletes an entire record if it finds "bagel" or "arbys" anywhere in the record. I want the macro to only delete records if the value is found in the following column headers "OPERATION" and/or "CATEGORY". If "bagel" or "arbys" is found in any other column I want the record to not necessarily be "kept" but only removed if those key words are found in either of the two column headers specified.
Thanks to anyone that can help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks