+ Reply to Thread
Results 1 to 2 of 2

Run macro on cell double click! - Half way there

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

    Run macro on cell double click! - Half way there

    Okay so I have two rows of yes/no cells and I would like to run a specific macro based on which cell was double clicked(yes/no)

    Problem is, the code I found runs no matter where I double click

    Heres the code I have:

    Please Login or Register  to view this content.
    This macro should only run for one specific sheet, as other sheets will have macros like this on running(same setup of sheets for different info)

    Yes No Info 1
    Yes No Info 2
    Yes No Info 3

    How can I define my function so that it only run when I double click in a specific range.

    FYI: My macro is relative so it will change based on which box I click

    =-=-==-==-=-=-=-=-=--==-=--==--=-=-==--==-=--==-
    Edit:

    I figured it out!

    Please Login or Register  to view this content.
    make sure to put it in the sheet and not the module window!
    Last edited by jlab89; 04-09-2012 at 12:32 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Run macro on cell double click! - Half way there

    What you need to do is put a test in to check which cell was double clicked. Note in the brackets "byval target as range". That means the procedure has a variable "target" that stores the range that was double clicked.

    So you need something like
    Please Login or Register  to view this content.
    Last edited by Mallycat; 04-09-2012 at 12:42 AM.

+ 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