Why are my macros running slower

  • Thread starter Thread starter Laurence Lombard
  • Start date Start date
L

Laurence Lombard

This is a long shot. My macros are running markedly slower than what they
used to. What can it be.

I have a PII and replaced the 2GB HD with a 40GB recently. I don't know
whether that has something to do with it.
Laurence
 
Common suggestions:

Clean up your windows temp folder.
turn off screenupdating when you start and turn it on when you're done.
turn calculation to manual when you start and reset it what it was when you're
done.
If your macro adds/removes rows or columns, then turn off the
displaypagebreaks. (Letting excel recalculate where it should draw those little
dotted lines can really slow it down.)

If you're doing pagesetup, only change the things you need to change--accessing
the printer driver can slow down excel, too. John Green posted a routine using
the older xlm macros:

http://groups.google.com/groups?threadm=VA.00000b2f.0028c7e5@mara9


At the top of many of my macros:

Dim CalcMode As Long
CalcMode = Application.Calculation
Application.Calculation = xlCalculationManual
ActiveSheet.DisplayPageBreaks = False

and near the bottom:

Application.Calculation = CalcMode
Application.ScreenUpdating = True

(activesheet should be used only if your code is running against the, er,
activesheet.)

If that didn't help, maybe you can find something at these two sites
(Charles Williams and David McRitchie):

http://www.decisionmodels.com
http://www.mvps.org/dmcritchie/excel/slowresp.htm
 
Back
Top