Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default Delete all rows except

Hello ( Excel 2002)My worksheet has about 3900 rows. I need to delete all
rows that do not have the following numbers
15,16,18,21,23,40,106,108,110,114,(there is a total of 34 different numbers)
These numbers are found in column A. also I do not want to delete row 1
that has the titles. I need a macro because I have over 100 files . Help
and Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Delete all rows except

Hi Marilyn

See
http://www.rondebruin.nl/delete.htm

You can use this example from the site in the macro

Replace
If .Value = "ron" Then .EntireRow.Delete

With

If IsError(Application.Match(.Value, _
Array(15, 16, 18), 0)) Then .EntireRow.Delete

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Marilyn" wrote in message ...
Hello ( Excel 2002)My worksheet has about 3900 rows. I need to delete all
rows that do not have the following numbers
15,16,18,21,23,40,106,108,110,114,(there is a total of 34 different numbers)
These numbers are found in column A. also I do not want to delete row 1
that has the titles. I need a macro because I have over 100 files . Help
and Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default Delete all rows except

Thank You Ron. EXCELLENT!

"Ron de Bruin" wrote:

Hi Marilyn

See
http://www.rondebruin.nl/delete.htm

You can use this example from the site in the macro

Replace
If .Value = "ron" Then .EntireRow.Delete

With

If IsError(Application.Match(.Value, _
Array(15, 16, 18), 0)) Then .EntireRow.Delete

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Marilyn" wrote in message ...
Hello ( Excel 2002)My worksheet has about 3900 rows. I need to delete all
rows that do not have the following numbers
15,16,18,21,23,40,106,108,110,114,(there is a total of 34 different numbers)
These numbers are found in column A. also I do not want to delete row 1
that has the titles. I need a macro because I have over 100 files . Help
and Thanks


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
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
Delete rows tjc New Users to Excel 4 October 4th 05 04:26 PM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
delete empty rows between rows with text Paulo Baptista Excel Discussion (Misc queries) 2 February 28th 05 03:41 PM


All times are GMT +1. The time now is 05:03 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"