Thread
:
do not delete rows in a list.
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
do not delete rows in a list.
one way
Sub deleteifnot()
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To 4 Step -1
If Cells(i, "a") < "a" And _
Cells(i, "a") < "b" And _
Cells(i, "a") < "c" Then Rows(i).Delete
Next i
End Sub
--
Don Guillett
SalesAid Software
"steven" wrote in message
...
Hello
unlike most of the post I'd lke the code to a macro that does not delete
rows. To be more specific I'd like my macro to check the values of column
E
of the list, for 3 criteria, and if any of the three exist then to KEEP
these
rows and delete all the others.
I guess it would have to be a macro similar to the one found at
http://www.rondebruin.nl/delete.htm
only instead of deleting the rows that
meet the criteria, keep these rows and delete the rest.
any help apreciated
Steven.
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett