Microsoft Excel Workbook Becomes Slow After a VBA Macro
Question details
The user needs to identify and resolve performance issues in a macro-enabled Excel workbook that becomes sluggish after a VBA macro changes worksheet visibility.
- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A macro hides one worksheet and unhides another in a macro-enabled workbook. The workbook responds normally when first opened but becomes slow when the user moves between cells after the macro runs.
- Observed behavior
- Cell navigation becomes sluggish after the macro executes, although the workbook is initially responsive.
Save a test copy of the workbook and place it in a local folder rather than on a network or cloud-synced location. Note whether the slowdown occurs only after the worksheet-switching macro runs and whether it persists after restarting Excel.
Optimize the VBA macro and control screen updating
Use this approach when the slowdown starts immediately after the macro runs and the code changes worksheet visibility or many cells.
Repeated Select and Activate statements can force Excel to redraw the workbook unnecessarily. Event procedures may also run while the macro changes worksheets or cell values, causing repeated calculations or code execution.
In Excel, press Alt+F11 to open the Visual Basic for Applications editor, then open the module containing the worksheet-switching macro.
Add Application.ScreenUpdating = False before the main macro code and Application.ScreenUpdating = True after it finishes. Use error handling when appropriate so screen updating is restored if the macro stops unexpectedly.
Replace unnecessary Select and Activate statements with direct references such as Worksheets("Sheet1").Range("A1").Value or Worksheets("Sheet1").Visible = xlSheetHidden.
If the macro changes many cells, review Application.Calculation and Application.EnableEvents settings and restore their original values after the macro completes. Do not leave events or automatic calculation disabled for normal workbook use.
Inspect worksheet events, formulas, and workbook formatting
Use this approach when the workbook remains slow after the macro finishes or when moving between cells triggers additional processing.
Isolate add-ins, storage, and file-format causes
Use this approach when code and worksheet design appear reasonable but the workbook is still slow on particular computers or locations.
Try WPS Office for Lightweight Spreadsheet Work
WPS Office is a free, lightweight alternative for opening, editing, and sharing common Excel workbooks. Its familiar spreadsheet interface supports a smooth migration for everyday workbook tasks, while complex VBA macros should still be tested in Microsoft Excel for full compatibility.
- 1. Install WPS Office: Download and install WPS Office, then open WPS Spreadsheets from the Start menu or Applications folder.
- 2. Open the workbook: Select Open from the WPS Spreadsheets home screen and choose the .xlsx, .xls, or .csv file you want to review.
- 3. Review workbook performance: Test worksheet navigation, formulas, charts, and formatting in WPS Spreadsheets. For VBA-dependent behavior, return to Microsoft Excel and verify the macro separately.

Frequently Asked Questions
Why does Excel become slow only after the VBA macro runs?
The macro may trigger worksheet events, recalculation, screen redraws, or repeated selections after it changes worksheet visibility. Review event procedures and reduce Select and Activate statements in the VBA editor.
How can I stop a macro from repeatedly triggering worksheet events?
In the macro, temporarily set Application.EnableEvents = False before the operation and restore Application.EnableEvents = True afterward. Make sure the setting is restored even if the macro encounters an error.
What does Application.ScreenUpdating = False do in Excel VBA?
It prevents Excel from redrawing the screen during macro execution, which can reduce flickering and improve run time. Set Application.ScreenUpdating = True when the macro finishes.
Can add-ins make a macro-enabled workbook sluggish?
Yes. Add-ins can add event handlers or background processing. Start Excel with excel /safe or disable COM add-ins through File > Options > Add-ins > Manage COM Add-ins > Go, then test the workbook again.
Does saving the workbook as XLSB improve Excel performance?
An .xlsb file can reduce file size and improve opening or saving for some large workbooks, but it does not automatically fix inefficient VBA, event procedures, formulas, or conditional formatting. Test a copy before changing the format.




