+ Reply to Thread
Results 1 to 4 of 4

Can Excel Record Mouse Coordinates/Clicks?

  1. #1
    Registered User
    Join Date
    08-31-2012
    Location
    Amherst, MA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Can Excel Record Mouse Coordinates/Clicks?

    I want to be able click on a bar of some kind (be it a jpg or some clip art or something) and generate a number based on where the line is clicked. So, perhaps, clicking to the far left of the line will generate a value of 00, and clicking to the far right will generate a value of 99.

    The best method I have come up with is making 100 narrow columns, and having a bit of VBA code return values somewhere else based on what column the cell that was clicked was in. So, in this system, clicking on a cell in row C would generate a value of 02, and clicking on a cell in row Z would generate a value of 25. The problem with this approach, is that I haven't been able to figure out the VBA code to return a value after a click which is linked to the column of a cell.

    any better ideas? I'm open to absolutely everything!
    Last edited by Rufius; 09-01-2012 at 07:24 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,150

    Re: Can Excel Record Mouse Coordinates/Clicks?

    Maybe use a Scroll Bar ... Developer Ribbon | Insert | Form Controls | Scroll Bar ... edit the properties to specify a Link cell where it will put the value (and change the increments, etc)


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    08-31-2012
    Location
    Amherst, MA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Can Excel Record Mouse Coordinates/Clicks?

    THShucks:

    Sorry!

    So I got it to work the way you said (insofar as linking to a cell, and the return value is concerned). The problem is: if I click inside the scroll bar on either side of the scroll box, the scroll box (and thus the value in the cell the scroll box is linked to) does not jump directly to the position I clicked (this seems to be somewhat controlled by the "page change" function).

    is there a way to make the scroll box go to exactly where I click immediately?
    Last edited by Rufius; 09-01-2012 at 06:45 PM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,150

    Re: Can Excel Record Mouse Coordinates/Clicks?

    I guess changing the page increments to 1, clicking and dragging the scroller, or clicking on the end arrows. Don't use these things as a rule, so it's going to be a case of trial an adjustment.

    Regards, TMS

  5. #5
    Registered User
    Join Date
    08-31-2012
    Location
    Amherst, MA
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Can Excel Record Mouse Coordinates/Clicks?

    Thankfully, I was able to figure this out:

    I used an ActiveX Image control ( Developer Ribbon | Controls | Insert | ActiveX Controls )

    and this code:
    Please Login or Register  to view this content.
    and now have exactly what I wanted!

    Thanks to TMShucks and Cutter for helping.

+ 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