• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

How do I suspend auto cals in MS Excel when running a VBA module

In a VBA module I turn off auto calculations at the beginning of the code.  At the end I turn it back on, but this is problematic as when I turn it back on in the code it re-ca calculates and takes forever since I have a lot of CountIFS and SUMIFS...

Any suggestions...

  • 2
2 Solutions
It sounds like you are already doing what you are asking for.  At some point, you are going to have to calculate the sheet, and if it takes a long time doing it automatically, it will still be slow doing it manually.

You might want to look into array functions in Excel, as they are much more efficient than lots of countifs/sumifs:

You can turn off autocalculation in Excel options(In Excel 2010, click File, Options), under the Formulas section.  You can then perform a manual calculation by pressing F9.
You can give this a try:

    With Application
        .Calculation = xlCalculationAutomatic
        .CalculateBeforeSave = False
    End With

upobDaPlayaAuthor Commented:
Sterling, I took a look at arrays and it makes sense.  However, how can I utilize arrays if I have several conditions to be met prior to a sum.  For example if cell A3 has to be >0 and B3>50 prior to summing certain cells how would I replace the SUMIF with an array ?


In the interim I will give your suggestion a shot.
upobDaPlayaAuthor Commented:
thank you...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now