How to Stop Excel from Automatically Flashing the Screen During Macros (VBA ScreenUpdating)

If you write Visual Basic for Applications (VBA) macros to automate tasks in Microsoft Excel, you have likely encountered a severe visual problem. When a macro executes a loop—such as copying data from one sheet, switching to a second sheet, pasting the data, and returning to the first sheet 500 times—Excel physically redraws the graphical user interface for every single step.

This causes the monitor to flash, flicker, and stutter violently for several minutes until the script finishes. Not only is this flickering highly distracting and potentially headache-inducing, but the act of forcing the graphics card to redraw the UI thousands of times actually slows down the execution of the macro by up to 80%.

To speed up your code and stop the flickering, you must temporarily disable Excel’s automatic screen updating engine during the macro’s execution.

How to Turn Off ScreenUpdating in VBA

You can control the Excel UI engine directly within your VBA code.

  1. Open your workbook in Microsoft Excel.
  2. Press Alt + F11 to open the VBA Editor.
  3. Locate the specific Macro (Subroutine) that is causing the screen to flash.
  4. At the very beginning of your code, immediately below the Sub MacroName() line, insert the following command:
Application.ScreenUpdating = False
  1. This command instantly freezes the Excel user interface. The script will continue to run in the background at maximum speed, but the screen will simply remain frozen on whatever was visible when the macro started.
  2. CRITICAL: You must turn the screen back on when the macro finishes, or Excel will remain permanently frozen. At the very end of your code, immediately above the End Sub line, insert:
Application.ScreenUpdating = True

By wrapping your code in these two commands, you eliminate the violent screen flashing and drastically improve the processing efficiency of your automated scripts.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.