LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Mouse position within worksheet

Ah, the brackets, how observant. Aircode I'm afraid but they were there by
intention!

Trust the demo worked, but please advise if anything not quite right.

Regards,
Peter T


"Andrew" wrote in message
...
Embarrassingly I failed to compute that top of A1 is just 0!! Too
busy thinking about everything else.

BTW, there's a bracket missing in your expression below though.
Should be:
(CursorPixelsX - PointsToScreenPixelsX(0)) * ppp * zoom%
since it's the distance from top left of A1 to the cursor which
changes with zoom etc. (I know you know this since it is what you
have in your code that you posted later).

Thanks!

On 10 Feb, 13:28, "Peter T" <peter_t@discussions wrote:
I think you may be missing one or two things (not sure), in essence the
position of the mouse pointer in points from the top-left corner of the
sheet is

CursorPixelsX - PointsToScreenPixelsX(0) * ppp * zoom%

where CursorPixelsX is returned from 'GetCursorPos' and ppp refers to
'Points-per-Pixel' typically 0.75 but confirmed with a few API calls.

There are one or two other things that might also need to be taken into
account. Having had another look at some old stuff I should be able to
post
a simple demo here later today, rather than something needing to be
wrapped
in a workbook.

Regards,
Peter T


<snip


 
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
How to get position of mouse via VB in a worksheet ratty Excel Programming 2 January 30th 09 09:28 AM
Mouse Position Jason Zischke Excel Programming 1 May 21st 07 06:39 AM
Position of the mouse pointer Liam Excel Programming 5 October 26th 06 02:20 PM
Mouse Position Max Potters Excel Programming 3 September 28th 04 06:09 PM
position mouse cursor in msg box swatsp0p[_2_] Excel Programming 2 September 24th 04 07:12 AM


All times are GMT +1. The time now is 09:47 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"