+ Reply to Thread
Results 1 to 3 of 3

Click Command Button, run macros based on cell value

  1. #1
    Registered User
    Join Date
    08-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Click Command Button, run macros based on cell value

    First post.....I inserted a photo in to a worksheet. I would like to use that photo as a command button - be able to click on that button and have it run one of two macros based on the value of a cell within the worksheet. I have attempted a couple suggestions in older posts without success. Can someone walk me through this?

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Click Command Button, run macros based on cell value

    1. insert the photo on the worksheet
    2. switch to the VBA editor (Alt-F11)
    3. insert a module
    4. create a public sub routine named (for example) pub_sub_Start
    5. in this macro query the cell that holds the value you want to use to call macro A or B
    6. assign macro pub_sub_Start to the inserted image (right-click and select assign macro)
    If you like my contribution click the star icon!

  3. #3
    Registered User
    Join Date
    08-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Click Command Button, run macros based on cell value

    Are you able to provide greater detail on creating the sub routine? My general excel skills are very good but I am somewhat new to VBA. Thank you.

+ 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