Consulting

Results 1 to 3 of 3

Thread: Getting the Name of the Calling Macro

  1. #1

    Question Getting the Name of the Calling Macro

    Does VBA have a way for an executing macro to determine the name of the macro that called it?

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You can setup your macros like this.

    Option Explicit
    
    Sub MyMacro()
    Call Macro1("MyMacro")
    End Sub
    
    
    Sub Macro1(Optional MyCaller As String)
    MsgBox MyCaller
    End Sub

  3. #3
    Yeah, I've taken that approach before, but somehow it seems clumsy to me. I'd really prefer executing a VBA command of some sort, if such exists. Thanx for the reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •