Screen flash while running macros

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?
 
G

Gary''s Student

Sub demo()
Application.ScreenUpdating = False
' your code goes here
Application.ScreenUpdating = True
End Sub
 
I

iliace

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top