Getting a macro to skip showing steps and just showing result

An anonymous Guest asked me:

Question

How do I get Excel to run a macro without showing all intermediate steps in a calculation? So, after I kick off the macro, there are no changes on the screen until the macro has finished…

Answer

This is done via the ScreenUpdating property of the Application object:

Application.ScreenUpdating = False

‘your code

Application.ScreenUpdating = True

This will also speed up the macro, as it won’t waste processing power on displaying the changes. Also, if it take a long time, you may want to add some information in the status bar for users of your macro to know it’s being processed.

Application.StatusBar = “Processing….”

‘your code here
Application.StatusBar = False

Advertisements

What do you think? Leave a comment.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s