LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Bulk Row Deletion - Fastest method

I have tried several different methods of deleting a lot of rows quickly.

I use test data in a single Excel sheet containing 54,102 rows by 22
columns. This data contained 24,266 rows targeted for deletion that were
interspersed within the data (all based on actual events routinely
encountered).

The fastest method I have found in benchmarking tests is to:

1. Use a "For...Each" loop to mark the rows for deletion in the sheet
2. Sort the data so that all the target rows are together
3. Delete all the target rows at the same time
4. If necessary, re-sort the data

This ran fastest (6.5 minutes - which still seems like a long time when you
have to do it repeatedly). Does anyone know of a faster method? If so, could
you please post your method? FYI, other methods I tried:

1. Copy target row numbers into an array, then step backward through the
array and delete the rows.

2. Filter the target rows, then delete the visible range.

3. Step backward through all rows in the sheet and immediatley delete any
target rows encountered.

4. These are all the methods I could think of. Anyone else have any ideas to
shave some time off of this process?

Thanks much in advance.
 
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
Fastest Way to Filter/Delete SyrHoop Excel Worksheet Functions 6 November 10th 04 06:33 PM
Bulk row deletion quartz[_2_] Excel Programming 1 November 9th 04 05:00 PM
Fastest way to enter many formulas ob3ron02[_15_] Excel Programming 0 October 27th 04 05:08 PM
Fastest way for comparing columns? Tony Excel Programming 4 July 17th 04 04:02 AM
Fastest way to do this? Abu Ali Excel Programming 4 January 12th 04 09:24 AM


All times are GMT +1. The time now is 01:58 AM.

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

About Us

"It's about Microsoft Excel"