Thursday, August 20, 2015

How to show VBA code execution status information on excel statusbar

There are several situations where we need to know execution status of macro code. we can show status of macro execution in excel status bar. Below block of code will help you to do this.



Sub Status_bar()
' Author: Dreams24
' Written for VBA Tricks and tips blog
' https://vbatricksntips.com

    oldStatusBar = Application.DisplayStatusBar
    Application.DisplayStatusBar = True
    Application.StatusBar = "Please be patient..."
    
    MsgBox "This is example to show information in statusbar !", vbInformation
    
    Application.StatusBar = False
    Application.DisplayStatusBar = oldStatusBar

End Sub

No comments: