get cursor position when clicking on an image

T

timspier

I want to be able to insert an image, say a jpeg or bmp, into a
worksheet. Then, I want to be able to click on a spot on that image and
have Excel record the X,Y coordinates where I clicked. I need to click
on several spots on an image and record the X,Y coordinates of each
spot, then determine the distance between spots. Any ideas?
 
N

NickHK

timspier,
Whilst you could assign a macro to the picture, you would somehow have to
translate the current mouse coordinates into those relative to picture.

Images on worksheets don't have events, but the image control does. You get
the coordinates in the Image1_MouseDown event.
Set it to .Autosize=true, so no blank space.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top