View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech[_2_] Jim Rech[_2_] is offline
external usenet poster
 
Posts: 533
Default Speed the macro works

The first thing is to make sure calculation mode is manual, at least while
the macro is running.

Also it may not be necessary for the macro to do more than one copy/paste,
depending on the layout of your data. A simplified example:

Range("A1:B3").AutoFill Range("A1:B99"), xlFillCopy

Here, there is data in the first two rows of the source range, A1:B2, and
row 3 is blank. I want to copy down the pattern of 2 data rows and 1 blank
row multiple times. Rather than doing a loop the above does it all at once.

--
Jim
"Under Pressure" wrote in message
...
I am relatively new to macro writing. I have written a macro that copies
30
lines of a spreadsheet ( this is a template for student report ) 300 times
into the rows below it. Works fine at first, quite fast as one wouls
expect.
However, as more sections of the 30 lines are copied, it goes slower and
slower and takes the best part of 20mins to complete. Any suggestions?

Under Pressure