TL;DR —
Application.Calculation = xlCalculationManualtells Excel to stop recalculating after every write and defer all recalculation to one pass. On a formula-heavy workbook this is the switch that actually makes a macro fast — far more than screen updating. But it is the most dangerous lever in VBA: leave it on Manual by mistake and formulas simply stop updating, with no visual cue, so the workbook shows stale, wrong numbers. Save the state, restore it in an error handler, and never leave it to chance:
Sub FastCalc()
Dim savedCalc As XlCalculation
savedCalc = Application.Calculation ' remember what it WAS
Application.Calculation = xlCalculationManual ' stop recalc after every write
On Error GoTo CleanExit
' ... thousands of writes, no recalc in between ...
Application.Calculate ' force one recalc when you need results
CleanExit:
Application.Calculation = savedCalc ' restore the SAVED state, not blindly Automatic
End Sub
Every time your macro writes to a cell, Excel recalculates the entire dependency chain that cell feeds. On a workbook with heavy formulas, that recalc — not the screen — is the real bottleneck. Manual mode lets thousands of writes land first and recalculates once. This guide is built on one idea — Calculation is the switch that buys the speed, and the one you can never afford to leave off, because its failure is invisible. Get that asymmetry and you will treat it with the respect it needs.
What you'll learn
- The mental model — every write triggers a full recalc; Manual defers it to one pass
- Why it is the real speed win on formula-heavy books (and ScreenUpdating is not)
- The rule that matters most — a leftover Manual state shows stale numbers with no warning
- Forcing a recalc mid-macro with
Application.Calculatewhen a later step needs a result - Restoring the saved state, not hardcoding
xlCalculationAutomatic - The
error 1004you hit when you set Calculation with no workbook open
The mental model: every write triggers a recalc
Excel's default is xlCalculationAutomatic: the instant any cell changes, Excel recalculates every
formula that depends on it, transitively. Interactively that is exactly what you want — you type a
number and totals update. But inside a macro that writes 10,000 cells, Excel runs the full dependency
recalculation up to 10,000 times, and on a real model each pass can touch thousands of formulas.
Application.Calculation = xlCalculationManual breaks that link. Writes land in the cells, but Excel
does not recalculate until you tell it to (or the user presses F9). You do all the writing cheaply,
then trigger one recalc at the end.
Application.Calculation = xlCalculationManual
Range("A1:A10000").Value = someArray ' 10,000 values in, zero recalcs
Application.Calculate ' one recalc, once
The three states are xlCalculationAutomatic, xlCalculationManual, and
xlCalculationSemiautomatic (automatic except for data tables). For macros you care about the first
two.
Why this is the real speed win
There is a hierarchy of macro speed switches, and people reach for them in the wrong order.
ScreenUpdating is the famous one, but it only removes screen redraws. On
a workbook full of VLOOKUP, SUMIFS, or volatile functions like OFFSET and INDIRECT, the redraw
is trivial next to the recalculation. Turn off ScreenUpdating alone and a calc-bound macro barely
speeds up; turn off Calculation and it can go from minutes to seconds. If you only set one switch on
a formula-heavy book, set this one. The two together — plus writing whole arrays instead of looping
cell by cell — is the standard fast-macro recipe.
The rule that matters most: a leftover Manual state is silent
Here is why Calculation is the dangerous switch. When ScreenUpdating is
left off, you see it — the screen is frozen. When Calculation is left on Manual, you see
nothing. The workbook looks completely normal. But every formula is frozen at its last computed
value. Someone edits an input, the total does not change, and they either notice much later or — worse —
they don't, and they send a report built on stale numbers.
This is the single most damaging leftover state in VBA, precisely because there is no symptom until someone trusts a wrong figure. So the discipline is stricter than for the cosmetic switches: always restore it, and restore it in an error handler so a mid-macro crash cannot strand the workbook in Manual.
' FRAGILE - if the loop errors, calculation is stranded on Manual and every
' formula in the workbook silently stops updating:
Application.Calculation = xlCalculationManual
DoRiskyWork
Application.Calculation = xlCalculationAutomatic ' never reached on error
The fix is the CleanExit pattern from the TL;DR: On Error GoTo CleanExit, and restore in the label.
See VBA On Error for the full treatment.
Restore the saved state, not a hardcoded Automatic
Almost every tutorial ends the macro with Application.Calculation = xlCalculationAutomatic. That is
a bug in disguise. The user may have deliberately put the workbook in Manual mode — heavy models
are often left on Manual so they don't recalc on every keystroke. Your macro runs, and now you have
silently flipped their workbook to Automatic, triggering exactly the slow recalcs they were avoiding.
The correct pattern is to save what you found and restore that:
Dim savedCalc As XlCalculation
savedCalc = Application.Calculation ' could be Manual or Automatic
Application.Calculation = xlCalculationManual
' ... work ...
Application.Calculation = savedCalc ' leave the workbook as you found it
A macro should leave the environment in the state it borrowed, not the state it assumed. This is the same "save-and-restore" habit that keeps ScreenUpdating's nested-call flicker away.
Forcing a recalc when a later step needs a result
Manual mode has a second trap that has nothing to do with restoring it. If your macro writes formulas and then reads the results those formulas produce, the reads will be stale — the formulas have not recalculated yet.
Application.Calculation = xlCalculationManual
Range("B1").Formula = "=SUM(A1:A100)"
Debug.Print Range("B1").Value ' stale - B1 has not recalculated yet
Application.Calculate ' recalc now
Debug.Print Range("B1").Value ' correct
Whenever a later step depends on a value an earlier write should have computed, call
Application.Calculate (whole application), ActiveSheet.Calculate (one sheet), or Range.Calculate
(one range) first. In Manual mode, results are only as fresh as your last Calculate call.
The error 1004 with no workbook open
One last gotcha: Application.Calculation can only be set when a workbook is open. Setting it from an
add-in or a startup routine while no workbook exists raises run-time error 1004. If your code runs
early in Excel's lifecycle, guard it with If Workbooks.Count > 0 Then before touching the property.
How ExcelMaster helps
Calculation gives the biggest speed-up of the three switches and carries the biggest risk. Using it
correctly means saving the prior state, forcing a recalc when a later step reads a formula result,
restoring the saved state in an error handler, and knowing it can throw 1004 with no workbook open.
Miss any of those and you get either a crash or, worse, a workbook full of silently stale numbers.
ExcelMaster handles the full
pattern for you. Describe the job — "recalculate this model after updating the assumptions" — and it
sets Manual mode, does the writes, calls Application.Calculate exactly where a result is needed, and
restores the calculation state you started with inside a CleanExit handler. The workbook comes back
exactly as the user left it, only faster.
Frequently asked questions
What does Application.Calculation = xlCalculationManual do?
It stops Excel from recalculating formulas automatically after every change. Writes still land in the
cells, but no formula recalculates until you call Application.Calculate or the user presses F9. On a
formula-heavy workbook this is the biggest single speed-up available to a macro, because it replaces
thousands of recalculations with one.
Why did my formulas stop updating after running a macro?
Almost certainly the macro set Application.Calculation = xlCalculationManual and did not restore it —
often because it errored before the restore line. The workbook is now in Manual mode, so formulas hold
their last computed value with no visual cue. Set Application.Calculation = xlCalculationAutomatic
(or press F9), and in your code restore the setting in an error handler so it cannot be stranded again.
Should I set Calculation back to Automatic or to what it was?
Restore what it was. Save the value first (savedCalc = Application.Calculation) and set it back
to savedCalc at the end. Hardcoding xlCalculationAutomatic silently overrides users who
deliberately keep a heavy model in Manual mode, forcing the slow recalcs they were avoiding.
How do I force a recalculation in VBA while in Manual mode?
Call Application.Calculate to recalculate everything, ActiveSheet.Calculate for one sheet, or
SomeRange.Calculate for one range. You need this whenever a later step reads a value that an earlier
formula write should have produced — in Manual mode those cells stay stale until you calculate.
Why do I get error 1004 when setting Application.Calculation?
Because Application.Calculation can only be set while a workbook is open. If your code runs at
startup or from an add-in before any workbook exists, the assignment raises run-time error 1004. Guard
it with If Workbooks.Count > 0 Then before setting the property.
Tested in
Tested in: Excel 365 (Windows 11), VBA 7.1 — last verified 2026-08-17.
Related guides: VBA ScreenUpdating · VBA EnableEvents · VBA On Error · VBA For Loop · VBA WorksheetFunction
