View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Excel VBA Code Execution Excel XP Vs Excel Office 2000

And one more thing to add to the top of your code:

ActiveSheet.DisplayPageBreaks = False

(maybe you weren't showing pagebreak lines in xl2k. When you have those little
dotted lines showing, then each time you delete a row, excel wants to update
that position. Turn off the pagebreaks and excel won't care (until later).)

You can try it by turning them off manually:
Tools|Options|view Tab|Uncheck PageBreaks

(in fact, try it both ways to see if you agree)

John Flynn wrote:

An application I have written runs in seconds in Excel
2000 but takes minutes using Excel 2002 the offending code
is the ActiveCell.EntireRow.Delete statement in the code
subset listed below. One by one rows are deleted taking
lots of time (XP) -- same code same everything Office
2000 - instantly. Any ideas are welcome.

Thanks

Do
If ActiveCell.Value = "Delete" Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Value = "" Or ActiveCell.Row 1000


--

Dave Peterson