To stop Excel from updating the screen while a macro is running, add the line Application.ScreenUpdating = False at the beginning of your code and Application.ScreenUpdating = True at the end. This prevents the screen from flickering every time a cell is changed or a sheet is selected, which significantly increases the execution speed of your VBA scripts.

What You'll Need

  • Microsoft Excel installed on a Windows or Mac computer.
  • The Developer tab enabled in the Excel Ribbon.
  • A basic VBA macro or a module where you intend to apply the setting.

Step-by-Step

  1. Open the Visual Basic Editor: Press Alt + F11 on your keyboard (or Option + F11 on Mac) to open the VBA editor window.
  2. Locate Your Macro: In the Project Explorer on the left, double-click the module or sheet object containing the subroutine (Sub) you want to optimize.
  3. Disable Screen Updating: Place your cursor immediately after the Sub YourMacroName() line. Type the following command and press Enter:
    Application.ScreenUpdating = False
    This tells Excel to stop refreshing the visual display of the worksheet until the code tells it to start again.
  4. Insert Your Main Code: Ensure the rest of your macro logic (loops, data entry, formatting) follows the disable command.
  5. Re-enable Screen Updating: Scroll to the bottom of your macro. Just before the End Sub line, type the following command and press Enter:
    Application.ScreenUpdating = True
    It is critical to turn this back on; otherwise, Excel may appear frozen or fail to show the results of your macro once it finishes.
  6. Save and Run: Press the Save icon or Ctrl + S, return to your Excel workbook, and run your macro to observe the difference in speed and visual stability.

Common Mistakes

  • Forgetting to reset the setting: The most common error is setting ScreenUpdating to False but forgetting to set it back to True at the end. While Excel usually resets this automatically when a macro finishes, relying on this can lead to glitches in certain versions or complex projects.
  • Placing the command in the wrong order: If you place Application.ScreenUpdating = False after a heavy loop or a series of sheet selections, those initial actions will still cause flickering. Always place it as the very first actionable line of the Sub.
  • Confusing it with Calculation: Some users try to use ScreenUpdating to stop formulas from recalculating. This is a separate setting (Application.Calculation). Screen updating only affects the visual "refresh" of the monitor, not the underlying data processing.

Tips

  • Combine with Calculation settings: For maximum speed, combine screen updating with calculation disabling. Use Application.Calculation = xlCalculationManual at the start and Application.Calculation = xlCalculationAutomatic at the end.
  • Use Error Handling: If your code crashes halfway through, the ScreenUpdating = True line may never be reached. To prevent this, use an On Error GoTo statement that directs the code to a cleanup section where screen updating is re-enabled before the macro exits.
  • Avoid excessive "Select" and "Activate": While disabling screen updating hides the jumping between sheets, the most efficient VBA code avoids .Select and .Activate entirely by referencing ranges directly (e.g., Sheets("Sheet1").Range("A1").Value = "Data").

Troubleshooting

If you have applied the code but the screen is still flickering or the workbook appears frozen, try these steps:

  • Check for Multiple Subs: If your main macro calls other smaller macros, ensure you aren't turning ScreenUpdating back to True inside one of those sub-macros, as this will override the main setting.
  • Force a Refresh: If the screen remains blank after the macro finishes, go to the Immediate Window in the VBA editor (Ctrl + G), type Application.ScreenUpdating = True, and press Enter.
  • Check for Modal Dialogs: If your code triggers a MsgBox or a UserForm, Excel will often force a screen refresh to display that window, regardless of the ScreenUpdating setting.
  • Verify Syntax: Ensure there are no typos in the command. It must be exactly Application.ScreenUpdating = False.

Frequently Asked Questions

Does disabling screen updating make the macro run faster?

Yes. Every time Excel updates the display to show a change, it consumes system resources. By skipping the visual update, the processor can focus entirely on executing the code, which often reduces runtime from minutes to seconds in large datasets.

Will this stop my formulas from updating?

No. ScreenUpdating only affects the visual display. Your formulas will still calculate in the background. To stop formulas from updating, you must change Application.Calculation to manual.

Can I use this to hide a specific sheet?

No. This setting stops the visual "jump" or "flicker" when switching sheets; it does not hide sheets from the user. To hide a sheet, use Sheets("SheetName").Visible = False.

Is it safe to leave ScreenUpdating as False?

It is not recommended. While Excel typically resets the state after a macro ends, leaving it off can make the application feel unresponsive or prevent the user from seeing the final results of the automation.

Does this work on Excel for Mac?

Yes, the Application.ScreenUpdating property is supported in VBA for both Windows and macOS versions of Excel.