Selecting a cell before working with it is the single biggest cause of slow VBA. Work with the Range object directly instead: ws.Range("A1").Value = "Total" does the same job as selecting A1 and typing into it, without forcing Excel to move the selection and redraw the screen. On a macro that touches thousands of cells, removing .Select is usually the difference between several seconds and almost none.
Recorded macros are full of it, because selecting is what you physically did while recording. It is the first thing worth changing in any recorded code.
What the slow version looks like
Sub SlowWay()
Sheets("Data").Select
Range("A1").Select
ActiveCell.Value = "Total"
Range("B1").Select
ActiveCell.Value = 100
End Sub
Five lines, two of which only move the cursor. Every Select forces Excel to update the screen and fire selection events.
What to write instead
Sub FastWay()
With ThisWorkbook.Worksheets("Data")
.Range("A1").Value = "Total"
.Range("B1").Value = 100
End With
End Sub
Fewer lines, no screen movement, and it works whichever sheet the user happens to be looking at.
Why it is faster, and why it is safer
Speed is only half the argument. Select makes your code depend on what is currently in front of the user, so a macro written this way breaks the moment it runs against the wrong sheet. Referring to ThisWorkbook.Worksheets("Data") is explicit: it does not matter what is active, and it does not matter if the user clicks somewhere while the macro runs.
It also stops the screen flickering, which is the thing that makes a macro feel slow even when it is not.
The exceptions
A few things genuinely require selection. ActiveWindow.FreezePanes works on the current view, and leaving the cursor somewhere sensible when a macro finishes is a courtesy. Those are deliberate uses at the end of a routine, not selection scattered through it.
Turning off screen updating for the rest
Once the selecting is gone, the next win is telling Excel not to redraw or recalculate while the macro runs:
Sub FastMacro()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
' ... your work here ...
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Both settings persist after the macro ends, so they must always be turned back on.
Always restore them, including on error
If the macro fails halfway through with ScreenUpdating still False, Excel looks frozen to the user and calculation stays manual, which quietly produces wrong numbers until someone notices. Restore both in an error handler, not only at the end of the happy path.
Common questions
How much faster is it really?
It depends entirely on how many operations you remove. On a handful of cells you will not notice. On a loop touching thousands of rows, removing Select and switching off screen updating routinely turns tens of seconds into under one.
Is ActiveCell always bad?
No. ActiveCell is the right tool when the macro is genuinely about wherever the user is standing, such as a macro assigned to a button that formats the current selection. It is wrong when used as a substitute for naming the cell you mean.
Do I need Select to copy and paste?
No, and copy-paste is often avoidable entirely. ws2.Range("A1:C10").Value = ws1.Range("A1:C10").Value transfers values with no clipboard involved, which is faster and does not disturb whatever the user had copied.
Why does my macro still flicker with ScreenUpdating off?
Usually something is switching it back on mid-run: a called routine that sets it True at its end, or an error handler that resets it. It can also happen if the macro activates another workbook.
When Formulas Aren’t Enough
Speed problems in Excel usually turn out to be structural:
- Volatile formulas — whole workbooks recalculating on every keystroke
- Row-by-row processing — work that should happen in memory happening on the grid
- Recorded macros in production — code that worked on ten rows and now runs on fifty thousand
A custom VBA tool is built for the volume you actually have, not the sample you tested on.
Macros Taking Minutes Instead of Seconds?
Tell us what the tool does and how much data it handles, and we’ll make it keep up.
Start a Project