+ Reply to Thread
Results 1 to 3 of 3

Button Clicked

  1. #1
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562

    Button Clicked

    I have a spreadsheet and on that spreadsheet there are various buttons that cause various subroutines to launch. Some of these buttons cause a user form to be launched to gather additional information needed within the subrountines.

    I am to the point where I have two buttons which both need to open a particular user form, but once the user form information has been gathered different subrountines need to run based on which button was pushed.

    Is there a way to capture which button was pushed?

    Thanks

    Jeff

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Boylejob,

    If the buttons were created using the Forms controls then yes you can.

    The code to use is...

    Btn = Application.Caller

    The Variable Btn will contain the name of the button or control that was selected by the user on the worksheet.

    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Thanks Leith! I know it had to be something simple, but I just was not able to find it.

    Jeff

+ 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