• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Show running macro name on status bar

I have many interconnected macros. I would like to show the macro name (if possible theis sequence no.) while running macros.
Code:
Sub FeatureNameandTimestamp1()
    Application.ScreenUpdating = False
    Columns("C:C").Select
    ActiveWindow.SmallScroll Down:=-24
    Selection.Replace What:="Parts", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
    Selection.Replace What:="Part definitely*", Replacement:="", LookAt:= _
        xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
    Selection.Replace What:="*name=", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
    
       Delete_Empty_Rows_inC ' Sub macro1
        SimpleColoringMechanism1 ' Sub macro2
        SimpleColoringMechanism2 ' Sub macro3
        InPartAddnew ' Sub macro4
        FeatureNameandTimestamp2 ' Sub macro5
        FeatureNameandTimestamp3 ' Sub macro6
        VBATrimFinal1 ' Sub macro7
        VBATrimFinal2 ' Sub macro8
    Application.ScreenUpdating = True
End Sub
 
Simplest method. Just insert following code (with different messages) before/after each macro is called (depending how you want to keep track of progress).

Code:
Application.StatusBar "Your message"

Then at end of code pass the control of status bar back to Excel by using...
Code:
Application.StatusBar = False
 
FYI - There's no built in process/procedure in VBA to get at currently running Macro name. Easiest method is to global/public variable, that will hold string. And then in each sub, add line to set the variable to appropriate value at start of the code.
 
Simplest method. Just insert following code (with different messages) before/after each macro is called (depending how you want to keep track of progress).

Code:
Application.StatusBar "Your message"

Then at end of code pass the control of status bar back to Excel by using...
Code:
Application.StatusBar = False
Working fine, just needed to put code like this:
Code:
Application.StatusBar =  "Your message"
 
Woops, had removed "=" sign by mistake, when I replaced what was in my actual code with "Your message". Sorry about that, glad you got it working.
 
Back
Top