Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Code slows down after a few runs

I have a some code that works fine for awhile and then suddenly slows down.
The code still works, just at a slow rate. Closing Excel, and even
restarting the computer does not "reset" the bug. I'm not sure what does,
but occassionally it will start working fine again, and then slow again.
I've narrowed it down to find that all code runs as it should except for any
line that has to do with deleting a cell or row.

Rows(X).Delete

Every time the code reaches the line above, there is a 3-4 second delay
before it processes the line and continues to the next line. As I said
before, this is an intermitten problem and I can't point out what exactly
causes it. Has anybody had this problem before, or does anybody knows how to
fix it?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Code slows down after a few runs

Hi Diverse Computing,

See Charles Williams at:

http://www.decisionmodels.com/optspeedd.htm

See Also David McRitchie at:

http://www.mvps.org/dmcritchie/excel/slowresp.htm



---
Regards,
Norman



"Diverse Computing" wrote in
message ...
I have a some code that works fine for awhile and then suddenly slows down.
The code still works, just at a slow rate. Closing Excel, and even
restarting the computer does not "reset" the bug. I'm not sure what does,
but occassionally it will start working fine again, and then slow again.
I've narrowed it down to find that all code runs as it should except for
any
line that has to do with deleting a cell or row.

Rows(X).Delete

Every time the code reaches the line above, there is a 3-4 second delay
before it processes the line and continues to the next line. As I said
before, this is an intermitten problem and I can't point out what exactly
causes it. Has anybody had this problem before, or does anybody knows how
to
fix it?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Code slows down after a few runs

I'm betting that if you add a line like:

ActiveSheet.DisplayPageBreaks = False

It'll start working ok again. This tells excel not worry about where to show
those dotted lines (where page breaks would be). This is useful since your
macro deletes rows or columns.

If you continue to show these dotted lines, then excel will want to calculate
where they go each time you delete a row.

Diverse Computing wrote:

I have a some code that works fine for awhile and then suddenly slows down.
The code still works, just at a slow rate. Closing Excel, and even
restarting the computer does not "reset" the bug. I'm not sure what does,
but occassionally it will start working fine again, and then slow again.
I've narrowed it down to find that all code runs as it should except for any
line that has to do with deleting a cell or row.

Rows(X).Delete

Every time the code reaches the line above, there is a 3-4 second delay
before it processes the line and continues to the next line. As I said
before, this is an intermitten problem and I can't point out what exactly
causes it. Has anybody had this problem before, or does anybody knows how to
fix it?


--

Dave Peterson
Reply
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
PrintPreview slows Code Execution Don Lloyd Excel Programming 3 April 6th 05 12:37 PM
Code slows on subsequent run Paul Mac. Excel Programming 3 November 4th 03 02:30 AM
VBA code slows to a snails crawl when screen saver activated Stephen Bain Excel Programming 2 October 30th 03 06:06 PM
Code runs every other time Mike Waldron Excel Programming 1 September 27th 03 03:54 PM
How to keep from going dizzy when my code runs TBA[_2_] Excel Programming 3 September 23rd 03 11:33 PM


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

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

About Us

"It's about Microsoft Excel"