View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dove Dove is offline
external usenet poster
 
Posts: 25
Default Delete every other line in LARGE worksheet

Not sure how much it will help but if you wrap the entire thing in
Application.ScreenUpdating = False and Application.ScreenUpdating = True
when done it may help speed things up as Windows won't be wasting time
blinking the screen on you...


"Jim Cone" wrote in message
...
This took about 4 seconds...

Sub AAA()
Dim N As Long
Dim rng As Range
Set rng = Range("A1", "A45000")

For N = 45000 To 2 Step -2
rng(N).EntireRow.ClearContents
Next
rng.EntireRow.Sort Range("A1")
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



wrote in message
oups.com...
Can anyone think of a FAST way to delete every other line in a 45,000
line worksheet?

I can do a loop with Range("A"&Loop).EntireRow.Delete, but it takes
almost 10 minutes.

I was thinking of somehow selecting every other line and doing one HUGE
delete, but not sure if Excel could handle that or if it would be any
faster.

Any ideas?!!

Thanks.