Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
do not delete rows in a list.
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete empty rows in list of data | Excel Programming | |||
how can you sort a list to delete blank rows ? | Excel Discussion (Misc queries) | |||
Delete rows that do not contain a list of values | Excel Programming | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions | |||
Delete a list of rows | Excel Programming |