Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Using the Status Bar.

Using the Status Bar

by Allen Wyatt
(last updated May 21, 2016)

2

Typically, one of the first things you do when you create a macro is use a command that turns off updating the screen display. This is done because the macro will run faster when it does not have to update the screen. When this is done, one of the most important things you can do is provide feedback to the user so they don't think their system has gone out to lunch.

A common method of providing feedback is through the use of the status bar. Using VBA, this is done with a code line similar to the following:

Application.StatusBar = "Updating past months..."

This line causes the message Updating past months... to display on the status bar of the application program. This message remains there until another message is written to the status bar, either by your macro or by Excel.

If you want to erase the message on the status bar, there are two ways you can do it. The first is to write an empty string to the status bar, as in the following code:

Application.StatusBar = ""

In this case, there is nothing between the quote marks, so an empty string is displayed on the status bar, erasing whatever was there before. The other method is to use the following line:

Application.StatusBar = False

Writing the logical value FALSE to the Application.StatusBar property erases whatever you wrote on the status bar before and restores the default status bar text.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12319) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Using the Status Bar.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Moving a Table Column

Want to move a column in a table very easily? You can do so by using the same editing techniques you are already using.

Discover More

Printing Just the Visible Data

In a large worksheet, you may want to display and print just a portion of the available data. Displaying the desired ...

Discover More

Choosing an Easy Exterior Wood Stain

One of the finishing touches that need to be applied to any wood project is, well, the finish. Wood stain is a natural choice ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Understanding the If ... End If Structure

One of the most basic of programming structures is the conditional structure: If ... End If. This tip explains how this ...

Discover More

Deleting Old Data from a Worksheet

If you keep on-going data in a worksheet, some of your data—over time—may need to be deleted. If you have an ...

Discover More

Opening a Workbook but Disabling Macros

Macros that run automatically when you open or close a workbook are quite helpful. You may not want them to run, however, ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 3?

2016-05-24 11:21:20

Glenn Case

When you do this, it's a good idea to include the Application.StatusBar = False statement as part of your error recovery routine so that you don't end up with a frozen status bar with a bad message after a crash.

If you don't normally use error recovers, to do this, you can just include

On Error GoTo ERR_RECOV

at the front of the procedure and

ERR_RECOV:
Application.StatusBar = False

just before the End Sub statement. Be sure that the flow of the procedure is such that you normally execute the Application.StatusBar = False statement if there is no error. If you get an error, execution will divert to that statement and the macro will end with the display status bar reset to normal conditions. This is something good to do with any conditions which might not reset if an error causes a crash, such as manual recalculation or Application.EnableEvents = False.


2016-05-21 11:35:23

Brian Lair

One more useful tidbit in this tip would be to say HOW to turn off screen updating. Fortunately, an Excel guru has already written about that: http://excelribbon.tips.net/T009151_Turning_Off_Screen_Updating.html


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.