View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default MACRO execution speed

Hi Eric

My guess is that you have lots of functions. Each time a single cell is
altered then everything recalculates. You can avoid that this way:

Application.Calculation = xlCalculationManual
'code here
Application.Calculation = xlCalculationAutomatic

If your code selects and activates then it's slow per se, and also demanding
on the graphical past of your system. Edit away all those things and try

Application.ScreenUpdating = False
'code here
Application.ScreenUpdating = True

That was the general stuff. Usually, combining the two above will increase
speed a lot. To optimize further we'd have to read the code.
--
HTH. Best wishes Harald
Followup to newsgroup only please

"ericd" skrev i melding
...
I have a Workbook that is 7.2 MB. It has lots of images, macros, range

names, etc. Whenever I try to write data to a cell or cells, or clear cell
contents using a macro, it is maddeningly slow. I am currently trying to
sort a list of only 44 values using a Userform list box and associated
macro, putting the selected values in one column, and the unselected in
another column. I could knit a sweater in the time it takes to execute.
Are there any settings I need to make to enhance speed? Is the speed (even
for such a small list) that much machine dependent? I am using a Pentium
III 386 with 512 MB RAM. Is the execution speed being influenced by the
size of the workbook? (I actually tried the same sorting routine in a
separate Workbook, and the results are almost instantaneous!) Any feedback
on this would be greatly appreciated.

Eric