Does anyone have a vba script to list the co-ordinates (latitude and longitude) of the activecell so that I can move the cursor to that position.
I have the following script which lists the cursor position, but would like the cell position co-ordinates.
I have the following script which lists the cursor position, but would like the cell position co-ordinates.
Code:
Dim MyPointAPI As POINTAPI
Private Type POINTAPI
x As Long
Y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal Y As Long) As Long
Public Sub MouseCursorGetOurXY()
'Following functions will need the above lib "user32" declarations
l = GetCursorPos(MyPointAPI) 'get our cursor position first
MsgBox CStr(MyPointAPI.x) & ", " & CStr(MyPointAPI.Y) 'displays cursor X Y coordinates
End Sub
Code:
Sub Worksheet_SelectionChange(ByVal Target As Range)
MouseCursorGetOurXY
end sub