+ Reply to Thread
Results 1 to 4 of 4

Determine text in button and use it in code

  1. #1
    Registered User
    Join Date
    05-24-2011
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    27

    Determine text in button and use it in code

    I want to have one sub() that runs when any button is pressed. The sub should determine what the text of the button is and do an if then statement for different code depending on the text of the button pressed.
    Any one have any ideas how to tackle this?

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Determine text in button and use it in code

    marrott2,

    At its most basic, and assuming that you are using form control buttons on a worksheet:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-24-2011
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    27

    Re: Determine text in button and use it in code

    Works like a charm. Thanks for the quick response!

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Determine text in button and use it in code

    You're very welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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