Application.StatusBar

The StatusBar property allows you to assign a text string to be displayed on the left of the statusbar.
This is an easy way to keep users informed of progress during a length macro.
This should definitely be used when you turn ScreenUpdating off and there is no sign of activity of the screen.
StatusBar messages are still displayed even when ScreenUpdating is turned off.
At the end of the process you must change the StatusBar property to False so it can return to its normal status.


Using the Status bar

If you switch the ScreenUpdating off to prevent the screen from flickering it is worth using the Status bar to keep the user informed about the current status of the macro.
If your macro takes a bit of time to complete using the status bar will ensure that the user does not think that the macro has crashed or is not responding.

   ' Make sure that the status bar is visible
Application.DisplayStatusBar = True

' Enter the message to be displayed
Application.StatusBar = "Please wait "

' **** Add Your Code Here ****

' When the macro has finished reset the status bar
Application.StatusBar = False

If you change the status bar to display a message to the user - make sure you reset it.


Excel

Application.StatusBar = "1 of 100" 
Application.StatusBar = False

Word

Application.StatusBar = "2 of 100" 
Application.StatusBar = False

PowerPoint

Application.StatusBar = "3 of 100" 
Application.StatusBar = False

Important

If you do not reset the StatusBar after you have finished with it your last message will remain until the application is closed.


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext