+ Reply to Thread
Results 1 to 4 of 4

identify cursor location within a userform and translate into scaled coordinates

  1. #1
    Forum Contributor
    Join Date
    04-23-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2013
    Posts
    116

    identify cursor location within a userform and translate into scaled coordinates

    Hello, all,

    I have a picture inserted into a userform and I would like to save the location on that picture where a user clicks relative to an initial click. So, for example, a user would click on a red dot on a certain image, then would click somewhere else on that same image. What would be saved is the relative x and y coordinates between those two clicks.

    Maybe this is already impossible, but to take it further, I would love to have the user also able to click on two sides of a scale, and use the relative difference in x to help translate those x and y coordinates from the picture into a scaled size. So, for instance, if |--------| appeared on the image and represented 1", despite the screen resolution, by clicking on the left and right of the scale we would know how to translate pixel coordinates into inches.

    Attached is a picture with an explanation.

    Is this at all possible? Does any one have the time to flush this out, or help get me started (I can make userforms, but this feels well beyond my ability)?


    Location explanation.png

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: identify cursor location within a userform and translate into scaled coordinates

    Assuming that your map is in Image1, this will store the location that the user clicks onto a worksheet.
    If the user left clicks, the data will be in columns A and B, Right clicking puts the data in D,E

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    04-23-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2013
    Posts
    116

    Re: identify cursor location within a userform and translate into scaled coordinates

    Thanks! This looks like a great starting point! I'll report back when I've figured everything out

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: identify cursor location within a userform and translate into scaled coordinates

    If you have two labels to serve as end markers. This might help the user interface. Click on the image to make an end point appear. Click on the end point to make it disappear.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Cursor location based on a different tab
    By pentair in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2014, 06:17 PM
  2. How would I identify why row my cursor is on?
    By Turtleman10 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2013, 05:39 AM
  3. Coordinates Rotate and Translate
    By ollydoyle in forum Excel General
    Replies: 9
    Last Post: 03-22-2012, 12:19 PM
  4. Give Location of Cells (coordinates)
    By semperfi360 in forum Excel General
    Replies: 4
    Last Post: 02-17-2009, 12:27 AM
  5. [SOLVED] Cursor Location
    By Glen in forum Excel General
    Replies: 2
    Last Post: 07-21-2005, 05:05 PM

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