View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
external usenet poster
 
Posts: 620
Default Improving speed with VBA

Steve,

Generally speaking, as long as the formulae are optimised, VBA will always
be much slower than built-in functions.

You can improve the speed of formulae if expressions are repeated by storing
the repeated expression in a separate cell, e.g.

=IF(SUM(A1:A100)0,SUM(A1:A100,"")

store =SUM(A1:A100) in a separate cell, A999 say, and use

=IF(A9990,A999,"")

meaning it only gets resolved once.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steven Cheng" wrote in message
...
I am using a series of sumproducts that filter a table of
data based on several criteria (e.g. if field1=X AND
field2=Y, etc...) and it would seem to be slowing the file
in terms of the recalculation speed. I have turned the
spreadsheet to manual calculation as the result. Would
writing the code in VBA to do the same thing that I am
doing with sumproduct be a performance improvement?