Is there anyway to determine the xy(z?) coorinates of the activeCell? I want to get this data so that I can use SetMousePos to position the mouse onto the activeCell.
TIA.
Bob
Is there anyway to determine the xy(z?) coorinates of the activeCell? I want to get this data so that I can use SetMousePos to position the mouse onto the activeCell.
TIA.
Bob
You may be looking for the .Top, .Left, .Height and .Width properties of a Range.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Not in terms of cells but in terms of "twips" (I think) so that I can use that information to relocate my mouse to the active cells.
I'm working in the current direction. It will reposition the mouse but not to the correct location. Any ideas where I'm going wrong?
TIA.
Bob
![]()
Type pointapi x As Long y As Long End Type Declare Function GetCursorPos Lib "user32" (lpPoint As pointapi) As Long Declare Function SetCursorPos Lib "user32" (ByVal xx As Long, ByVal yy As Long) As Long Public pos As pointapi Sub Macro1() Dim x, y As Long GetCursorPos pos MsgBox "Cursor Pos.x = " + Str(pos.x) MsgBox "Cursor Pos.y = " + Str(pos.y) x = ActiveWindow.PointsToScreenPixelsX(ActiveWindow.ActiveCell.Top) y = ActiveWindow.PointsToScreenPixelsY(ActiveWindow.ActiveCell.Left) MsgBox "activeCell.top = " + Str(x) MsgBox "activeCell.left = " + Str(y) Call SetCursorPos(x, y) End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks