Screen flash while running macros

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

I have a macro set up to run when you enter a worksheet. This macro
serarches out blank cells & hides the row that they are in. Is there a way
to prevent the screen from flashing while this macro is running?
 
Sub demo()
Application.ScreenUpdating = False
' your code goes here
Application.ScreenUpdating = True
End Sub
 
At the beginning of your macro, insert this line:

Application.ScreenUpdating = False

At the end of your macro (or in your error_exit, if you have error
handling), insert this line:

Application.ScreenUpdating = True

If your macro ever crashes and the screen stops updating, use this
line and paste it in the Immediate window (Ctrl+G to open window, Ctrl
+V to paste, then press Enter to execute):

Application.ScreenUpdating = True
 
Back
Top