LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Get points in a worksheet using mouse click

I have some code to get the x & y points on a mouseover, I'll try and dig it
out and modify to mouse-click.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rock" wrote in message
om...
The initial button click will essentially prompt the user to click on
the two calibration points. The program needs to be able to aquire x
and y data points that are clicked and then using these points, create
a new label control with the lower left and upper right corners of the
control on the control points that were clicked.

Rock

"Bob Phillips" wrote in message

...
Rock,

Here is some code to get the cursor position, but I am not clear how you
will run it, as pressing a button moves the cursor.

Private Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long

Private Type POINTAPI
x As Long
y As Long
End Type

Sub test()
Dim pPosition As POINTAPI
Dim lReturn As Long

lReturn = GetCursorPos(pPosition)
MsgBox "Cursor position is:" & vbCrLf & _
"x co-ordinate: " & pPosition.x & vbCrLf & _
"y co-ordinate: " & pPosition.y

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rock" wrote in message
om...
I am writing procedure in excel 2002 where I have imported a bitmap
image into a worksheet and I would like to digitize a few points (get
the x and y coordinates) when I click on the mouse.

I would like to press a macro button that would allow the user to
click on a lower left control point and an upper right control point
(points on the bmp that have known x and y values used for scaling)
and then draw a label control with corners through the control points.

I have searched the newsgroups, but have not seen how to do this.

Thanks for the help.

Rock



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Right Mouse Click StephenD Excel Discussion (Misc queries) 4 May 27th 09 04:24 PM
Custom mouse over series points Don Guillett Charts and Charting in Excel 1 March 26th 06 09:49 PM
Each Click of the Mouse D.Parker Excel Discussion (Misc queries) 13 April 28th 05 11:24 PM
get value of a cell with a mouse click Ken Wright Excel Programming 0 July 22nd 03 07:15 PM
Mouse Click Event Srinath Excel Programming 2 July 18th 03 04:03 AM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"