Loss of Speed During Copy Operation
The two biggest culprets in terms of slow code are recussive calls and
caculation settings. I am guessing that you are not getting into recursive
calls based on what you are doing (usually based on code execution of a
change event). Try setting calculations to manual
application.calculation = xlManual 'at the beginning of the procedure
application.calculation = xlAutomatic 'at the end of the procedure
HTH
"Marty" wrote:
Hello:
I'm using Excel 2003. I've written a utility to transfer selected data from
a 10,000 row by 20 column sheet (A) into a second sheet (B).
I want to maintain any format additions (cell background color, font
changes, cell comments, etc.) made by the user in sheet A, so I'm using this
type of statement in the code:
A.Cells(RO, COL).Copy Destination:=B.Cells(NewRO, NewCOL)
I have a counter programmed onto the screen to keep track of the row the
utility is working on. HERE IS THE PROBLEM: It starts out fast and then
slows way down. I would like to know if there is a way to maintain the speed
throughout execution of the code.
It seems like there's a memory buffer which gets full (or something).
Any suggestions?
Thanks in advance,
MARTY
|