+ Reply to Thread
Results 1 to 5 of 5

Get the macro name

  1. #1
    Registered User
    Join Date
    10-31-2009
    Location
    Turda, Romania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Get the macro name

    Hi all,

    I have a macro which do something, but I want also this macro to input his name into a cell.
    Ex.:
    Please Login or Register  to view this content.
    I need name "test" into a cell.
    Last edited by Voicu; 11-02-2009 at 08:44 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Get the macro name

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.

    Thanks.

    You can't call a Sub from the worksheet, only functions.
    Last edited by shg; 10-31-2009 at 04:00 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Get the macro name

    Hi,

    You don't say which cell, so change A1 below as appropriate.
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    10-31-2009
    Location
    Turda, Romania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Get the macro name

    Apology for my mistake. In cell A1, I want the name of macro with the same code, indifferent what name has macro.
    It is also good for me if in macro I can call a function which return the name of macro.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Get the macro name

    Hi,

    Are you saying that the text in A1 is the name of a macro that you want to run from within another procedure?

    If so just use

    Please Login or Register  to view this content.
    I prefer using the 'Call' instruction since it reminds you that what follows is a procedure name. However it's only necessary if you want to pass parameters to the procedure. You can just use the procedure name if you prefer.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1