View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Delete every other line in LARGE worksheet

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.