Sub DeleteServiceNotAPO()
For i=Range("B65536").end(xlup).row to 1 step -1
If cells(i,1).value="service" and Instr(1,cells(i,4).value,"APO", _
vbTextCompare) = 0 then
rows(i).Delete
End If
Next
End Sub
This would not delete if the cell contained "capote" for example. You
might want to make the check more stringent.
--
Regards,
Tom Ogilvy
"Rubix³ " wrote in message
...
Quick question -
Is there a way to implement this so that it can keep the "APO" lines if
they don't EXACTLY contain "APO?" - ie: Instead of "APO" in COL D,
there's "APO Contra," "APO blonde ale," etc. All of which I'd like to
keep.
Is there a wildcard command that says "if anywhere in the cell the text
APO is found, keep it?"
I'm just trying to cover all angles in case the user enters something
other than just "APO."
Thanks for reading.
---
Message posted from http://www.ExcelForum.com/