Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Mouse Coordinates
I want to position the mouse on the screen and press a shortcut key (like
Ctrl-d) to get the mouse coordinates. Thanks, James |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Mouse Coordinates
Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long Type POINTAPI X As Long Y As Long End Type Sub ShowPos() Dim lRetVal As Long Dim Pos As POINTAPI lRetVal = GetCursorPos(Pos) MsgBox Pos.X & ", " & Pos.Y End Sub You can use the OnKey method to assign it to a shortcut combination or select options in Tools=Macro=Macros after you select your macro. -- Regards, Tom Ogilvy "Zone" wrote: I want to position the mouse on the screen and press a shortcut key (like Ctrl-d) to get the mouse coordinates. Thanks, James |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get Mouse Coordinates
Tom, thank you very much. That's absolutely amazing! James
"Tom Ogilvy" wrote in message ... Declare Function GetCursorPos Lib "user32" _ (lpPoint As POINTAPI) As Long Type POINTAPI X As Long Y As Long End Type Sub ShowPos() Dim lRetVal As Long Dim Pos As POINTAPI lRetVal = GetCursorPos(Pos) MsgBox Pos.X & ", " & Pos.Y End Sub You can use the OnKey method to assign it to a shortcut combination or select options in Tools=Macro=Macros after you select your macro. -- Regards, Tom Ogilvy "Zone" wrote: I want to position the mouse on the screen and press a shortcut key (like Ctrl-d) to get the mouse coordinates. Thanks, James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reading Chart Coordinates with Mouse Events | Excel Programming | |||
Mouse Coordinates | Excel Programming | |||
Mouse X-Y Coordinates | Excel Programming | |||
Can I grab graph coordinates in Excel via the mouse with VB? | Charts and Charting in Excel | |||
Simple way to convert UTM ED50 coordinates to decimal coordinates? | Excel Programming |