Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete empty rows in list of data sswcharlie1 Excel Programming 5 January 7th 07 08:43 AM
how can you sort a list to delete blank rows ? Irishimp23 Excel Discussion (Misc queries) 3 February 23rd 06 11:21 PM
Delete rows that do not contain a list of values 5tin@ Excel Programming 1 September 23rd 05 12:02 PM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
Delete a list of rows John Fevens Excel Programming 3 June 18th 04 01:11 AM


All times are GMT +1. The time now is 02:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"