View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default Updating range properties is so sloooow!!!

Try to set Range properties once for as large a range of cells as possible
rather than one cell at a time.
And using With or Set will also speed things up.

The basic approach for speed is to minimise the number of . that are
executed


Charles
______________________
Decision Models
The Excel Calculation Site.
www.DecisionModels.com

"Frank_Hamersley" wrote in message
...
I have been profiling a Excel solution I have built and have just

discovered
that this particular statement ...

rngCell.NumberFormat = xlHAlignCenter ' where Dim rngCell

As
Range

... adds 0.61 secs of run time - when called only 2,000 times!!!!!

This is running on a W2Kmachine with Pentium4 2.8 GHz with 533MHz FSB and

1G
RAM - ie. no swapping!

Is working with Range object properties always this slow? Would using a
With rngCell statement and then performing all of the property updates in
one fell swoop speed things up?

Has any one found another way to whip this into shape?

Cheers,
Frank.