LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using SpecialCells().EntireRow.Delete on large worksheet - Very slow!

A follow on the subject:
Following CHORDially's advice, I solved the issue by filtering my data
(using IsNumber True/False) and then copying the selected range to a
new sheet. This way you avoid multiple rows being deleted and jamming
Excel for long minutes.
Here is the sub I used:
---------------------------------------------------
Sub MoveNumRows()
' Moves only rows with number in sheet3-column A to sheet4
Dim My_Range As Range
Dim Last_Row As Double
Dim Rng As String

Application.ScreenUpdating = False
Last_Row = Find_Last_Row(Sheet3, 3, 1) 'Find the last row in
sheet3
Range("aa3").Formula = "=ISNUMBER(A3)"
Rng = "aa3"
Set My_Range = Range(Rng)
My_Range.Select
Selection.AutoFill Destination:=Range("aa3:aa" & Last_Row),
Type:=xlFillDefault
Range("aa3").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="TRUE"
Range("A2:y2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Sheet4").Select
Range("A1").Select
ActiveSheet.Paste
Application.ScreenUpdating = True
End Sub
---------------------------------------------------
Thanks all,
Ilan

(Ilan) wrote in message . com...
Thank you all for your help.
I added the "Application.Calculation = xlCalculationManual " Tom
suggested and looping from the bottom-up and it did improve, though
not a lot.
However, when I run the macro a second time, it starts very slow right
from the begining. So I have to close the file and re-open it.

I'm no expert in Excel, but it looks as if the application reserves a
lot of resources for the file and frees them only after the file is
closed, something like the Clipboard or Undo. If this makes any sense,
is there a way to disable them?

Ilan

 
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
Need Help with ActiveCell.EntireRow.Delete Ayo Excel Discussion (Misc queries) 4 July 20th 08 11:07 AM
Need Help with ActiveCell.EntireRow.Delete Ayo Excel Discussion (Misc queries) 8 July 19th 08 04:45 PM
delete entirerow if date more than 12months old flow23 Excel Discussion (Misc queries) 1 May 25th 06 03:32 PM
Simple worksheet becomes large and slow Judy Excel Discussion (Misc queries) 3 May 10th 05 10:52 PM
entirerow.delete multiple text conditions Jocelyn[_3_] Excel Programming 3 February 9th 04 05:58 PM


All times are GMT +1. The time now is 11:36 PM.

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"