ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   workbook macros now run VERY slowly ... ideas please (https://www.excelbanter.com/excel-programming/367395-workbook-macros-now-run-very-slowly-ideas-please.html)

wdeleo[_2_]

workbook macros now run VERY slowly ... ideas please
 
I made some revisions to a workbook and when I went to run the macros later I
noticed that everything was running terribly slow (seconds to minutes for
something that was instantaneous before). The workbook size had also
increased from 1.5 megs to 40 megs. I identified the reason for the size
increase (autofilter copy/paste included too many rows) and reduced the size
back to the 1.5 megs. BUT, it still runs at snail's pace. The CPU stays
pegged at about 50% while the macros are running, but it shouldn't be taking
so long.

Does anyone have a suggestion as to how I might be able to identify/rectify
the problem?

TIA

WD

Josh Sale

workbook macros now run VERY slowly ... ideas please
 
Visible page breaks can do this. Try adding this line of code:
activeSheet.DisplayPageBreaks = False
at the start of the code and after any macro code that will cause page
breaks to be added to the worksheet.

I'm guessing that you're really running the CPU at 100% but that you're on a
hyperthreaded or dual core system and so it only shows as 50%.

josh




"wdeleo" wrote in message
...
I made some revisions to a workbook and when I went to run the macros later
I
noticed that everything was running terribly slow (seconds to minutes for
something that was instantaneous before). The workbook size had also
increased from 1.5 megs to 40 megs. I identified the reason for the size
increase (autofilter copy/paste included too many rows) and reduced the
size
back to the 1.5 megs. BUT, it still runs at snail's pace. The CPU stays
pegged at about 50% while the macros are running, but it shouldn't be
taking
so long.

Does anyone have a suggestion as to how I might be able to
identify/rectify
the problem?

TIA

WD




wdeleo[_2_]

workbook macros now run VERY slowly ... ideas please
 
I tried what you suggested but it did not help. Other suggestions? It is
VERY slow.

Thanks


"Josh Sale" wrote:

Visible page breaks can do this. Try adding this line of code:
activeSheet.DisplayPageBreaks = False
at the start of the code and after any macro code that will cause page
breaks to be added to the worksheet.

I'm guessing that you're really running the CPU at 100% but that you're on a
hyperthreaded or dual core system and so it only shows as 50%.

josh




"wdeleo" wrote in message
...
I made some revisions to a workbook and when I went to run the macros later
I
noticed that everything was running terribly slow (seconds to minutes for
something that was instantaneous before). The workbook size had also
increased from 1.5 megs to 40 megs. I identified the reason for the size
increase (autofilter copy/paste included too many rows) and reduced the
size
back to the 1.5 megs. BUT, it still runs at snail's pace. The CPU stays
pegged at about 50% while the macros are running, but it shouldn't be
taking
so long.

Does anyone have a suggestion as to how I might be able to
identify/rectify
the problem?

TIA

WD





wdeleo[_2_]

UPDATE - more info
 
If I turn calculation to manual, one particular simple macro takes much less
than a second. If I manually calculate (F9), calculation takes ~0.5 seconds.
If I turn calc back to manual, the same macro takes about one MINUTE. How
can I figure out where the hold-up is???



"Josh Sale" wrote:

Visible page breaks can do this. Try adding this line of code:
activeSheet.DisplayPageBreaks = False
at the start of the code and after any macro code that will cause page
breaks to be added to the worksheet.

I'm guessing that you're really running the CPU at 100% but that you're on a
hyperthreaded or dual core system and so it only shows as 50%.

josh




"wdeleo" wrote in message
...
I made some revisions to a workbook and when I went to run the macros later
I
noticed that everything was running terribly slow (seconds to minutes for
something that was instantaneous before). The workbook size had also
increased from 1.5 megs to 40 megs. I identified the reason for the size
increase (autofilter copy/paste included too many rows) and reduced the
size
back to the 1.5 megs. BUT, it still runs at snail's pace. The CPU stays
pegged at about 50% while the macros are running, but it shouldn't be
taking
so long.

Does anyone have a suggestion as to how I might be able to
identify/rectify
the problem?

TIA

WD





[email protected]

UPDATE - more info
 
Is it possible for u to post the code here, so I can see what it is
doing?

wdeleo wrote:
If I turn calculation to manual, one particular simple macro takes much less
than a second. If I manually calculate (F9), calculation takes ~0.5 seconds.
If I turn calc back to manual, the same macro takes about one MINUTE. How
can I figure out where the hold-up is???



"Josh Sale" wrote:

Visible page breaks can do this. Try adding this line of code:
activeSheet.DisplayPageBreaks = False
at the start of the code and after any macro code that will cause page
breaks to be added to the worksheet.

I'm guessing that you're really running the CPU at 100% but that you're on a
hyperthreaded or dual core system and so it only shows as 50%.

josh




"wdeleo" wrote in message
...
I made some revisions to a workbook and when I went to run the macros later
I
noticed that everything was running terribly slow (seconds to minutes for
something that was instantaneous before). The workbook size had also
increased from 1.5 megs to 40 megs. I identified the reason for the size
increase (autofilter copy/paste included too many rows) and reduced the
size
back to the 1.5 megs. BUT, it still runs at snail's pace. The CPU stays
pegged at about 50% while the macros are running, but it shouldn't be
taking
so long.

Does anyone have a suggestion as to how I might be able to
identify/rectify
the problem?

TIA

WD







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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com