View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Umlas, Excel MVP Bob Umlas, Excel MVP is offline
external usenet poster
 
Posts: 320
Default Find and Delete full row macro (with exceptions)

Try this:
Sub DeleteServiceNotAPO()
For i=Range("B65536").end(xlup).row to 1 step -1
If cells(i,1).value="service" and cells(i,4).value<"APO" then
rows(i).Delete
End If
Next
End Sub

"Rubix³ " wrote:

Hey all

I've done "find and delete entire row based on value of a cell," but
the solution to this latest mess I'm in eludes me. I've tried a dozen
different techniques (not kidding).

Anyways, here's the deal. In Col B, I have different "issue types."
Stuff like, "administrative," "image," and " Service ."

When "Service" is present in COL B, I have to note the value in the
same row, COL D. If this value is "APO," then I KEEP it. Anything else,
delete.

In other words, all instances of "service" in COL B that DO NOT have
the value "APO" in column D, delete entirerow.

Thanks for reading.


---
Message posted from http://www.ExcelForum.com/