Fix Excel Screen Flickering When Application.EnableEvents Is True
Question details
The user is experiencing continuous screen flickering while running an Excel VBA macro to copy and paste data across columns.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Running a VBA macro that involves copying and pasting several columns across worksheets while Application.EnableEvents is set to True.
- Observed behavior
- The screen flickers continuously during the macro's execution because underlying event procedures are being triggered repeatedly by the copy-and-paste operation.
Before modifying your VBA code, press CTRL + S to save your workbook, as interrupting macros with disabled events might temporarily leave your spreadsheet unresponsive to normal interactions.
Temporarily Disable Events and Screen Updating in Your Macro
Turn off both application events and screen updating during the copy-paste operation to prevent background macros from triggering and causing flickers.
When Application.EnableEvents is True, pasting data can trigger events like Worksheet_Change. If these background events run repeatedly or toggle screen settings, the display will flicker. You can wrap your main copy-paste logic in a block that disables these features temporarily.
It is crucial to include an error handler so that if your macro fails mid-execution, Excel will still restore the event and screen updating settings to True.
Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor, and locate your macro module.
At the beginning of your subroutine, type 'On Error GoTo CleanUp' to ensure the code jumps to a safe restoration block if an error occurs.
Add 'Application.EnableEvents = False' and 'Application.ScreenUpdating = False' right before your copy-and-paste logic begins.
At the end of your code, create a 'CleanUp:' label and add 'Application.ScreenUpdating = True' followed by 'Application.EnableEvents = True' to restore normal behavior.

Review and Optimize Underlying Event Procedures
Inspect the VBA code in your worksheets to find and remove redundant ScreenUpdating toggles that cause flickering when triggered.
Run and Edit VBA Macros Seamlessly in WPS Spreadsheet
WPS Office provides robust built-in support for VBA and macros, allowing you to seamlessly run, edit, and optimize your Excel scripts without screen flickering issues or heavy performance drops.
- 1. Open Your Workbook: Launch WPS Spreadsheet and open your macro-enabled workbook (.xlsm).
- 2. Access Developer Tools: Navigate to the 'Developer' tab on the top ribbon. If it is hidden, you can enable it in the WPS Options menu.
- 3. Open the VBA Editor: Click 'Visual Basic' or 'Macros' to access your VBA scripts within the built-in editor.
- 4. Optimize Code: Implement the ScreenUpdating and EnableEvents optimizations directly in your macro to prevent screen flickering during execution.

Frequently Asked Questions
Why does Application.EnableEvents = True cause my screen to flicker?
The setting itself doesn't cause flickering. When set to True, it allows background event triggers (like Worksheet_Change) to fire during tasks like pasting. If these event macros contain commands that refresh the screen or toggle ScreenUpdating rapidly, it results in a noticeable flickering effect.
What happens if my macro crashes while Application.EnableEvents is False?
Excel will stop responding to events entirely. Actions like clicking cells, changing data, or switching sheets won't trigger their expected macros. You can fix this manually by typing 'Application.EnableEvents = True' in the Immediate Window (CTRL + G) of the VBA Editor and pressing Enter.
Does turning off Application.ScreenUpdating speed up my macro?
Yes. By setting Application.ScreenUpdating = False at the beginning of your script, Excel stops redrawing the visual interface after each background operation. This not only eliminates screen flickering but also significantly reduces the macro's total execution time.




