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

Using the Status Bar

Written by Allen Wyatt (last updated January 18, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


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.

Using the status bar is all fine and good, as long as the status bar is turned on. Excel can be customized, by the user, so that the status bar is turned off. If this has been done, then you cannot display messages on the status bar. The solution is to make sure the status bar is turned on before you try to display a message.

You can control the display of the status bar by using the Application.DisplayStatusBar property. If you set this property to a logical value (TRUE or FALSE), it turns the status bar on or off.

As an example of how to program this sort of process, consider the following code:

bStatusState = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Application.StatusBar = "Updating past months..."
'
' Rest of program goes in here
'
Application.StatusBar = False
Application.DisplayStatusBar = bStatusState

The very first line of this code assigns the current value of the status bar (TRUE or FALSE, meaning on or off) to the variable bStatusState. This same variable is used in the last line to reset the status bar condition to its original state. In between, the status bar is turned on and a message is displayed and later erased.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2296) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) 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

Hiding a Hyperlink on a Printout

Hyperlinks can be real handy in a workbook, but you may not always want them visible when you send the workbook to the ...

Discover More

Finding the Dates for Minimums and Maximums

If you use Excel to maintain a collection of data, you may need to find information in one column based on information in ...

Discover More

Creating See-Through Text Boxes

When laying out your document, you may want to use a text box that appears to be positioned over your text, but to be ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (menu)

Running a Macro when a Workbook is Closed

One of the automatic macros you can set up in Excel is one that is triggered when a workbook is closed. This tip explains ...

Discover More

Finding the Last-Used Cell in a Macro

Ever wonder what the macro-oriented equivalent of pressing Ctrl+End is? Here's the code and some caveats on using it.

Discover More

Extracting Proper Words

If you've got a list of potential words, and you want to know which of those potential words are real, you'll appreciate ...

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}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. 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 two more than 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon 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.