+ Reply to Thread
Results 1 to 2 of 2

VBA to read "Name" of macro button

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    Lausanne, Switzerland
    MS-Off Ver
    Excel 2007
    Posts
    1

    VBA to read "Name" of macro button

    I would like to assign a macro to different "buttons" on a sheet - each button will be given a name ("define name")
    When clicking on the "button" i would like to start a VBA (assign macro) and the macro should goto a cell on another sheet (with "application.goto reference...") - so far so good.

    Now to avoid having 10 macros, I would like to give a name to each "button" and when I click on the button I would like to first "read" the name of the button (store it in a variable) to use this as the reference target to goto... (By using the variable in stead of a "fix" name...

    Question clear? Thanks a lot for your help on what function to use to read the name of the "clicked active button" and store it in a variable.

    Merci

    Goepf

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: VBA to read "Name" of macro button

    Goepf

    You can use Application.Caller to get the name of the button that was clicked.
    If posting code please use code tags, see here.

+ 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