Display cursor position in cell

R

Regina Rodler

Hello there,

is it possible, and if so, how, to show X- and Y-coordinates
of the cursor position in a range / cell while mouse moves ?

Thank you in advance,

Regards,

RR
 
P

Paul B

Regina, here is one way, right click on the worksheet tab and view code,
paste this in the window that opens
will put the cell address in A1, change to the cell you want

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
[A1] = ActiveCell.Address
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
R

Regina Rodler

Thank you Paul,

but what I need is a continuous display of coordinates of actual
coordinate-values whenever mouse is moved.

RR

Paul B said:
Regina, here is one way, right click on the worksheet tab and view code,
paste this in the window that opens
will put the cell address in A1, change to the cell you want

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
[A1] = ActiveCell.Address
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

Regina Rodler said:
Hello there,

is it possible, and if so, how, to show X- and Y-coordinates
of the cursor position in a range / cell while mouse moves ?

Thank you in advance,

Regards,

RR
 
R

Regina Rodler

Thank you Paul,

but what I need is a continuous display of
actual cursor position as mouse is moved.

RR

Paul B said:
Regina, here is one way, right click on the worksheet tab and view code,
paste this in the window that opens
will put the cell address in A1, change to the cell you want

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
[A1] = ActiveCell.Address
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

Regina Rodler said:
Hello there,

is it possible, and if so, how, to show X- and Y-coordinates
of the cursor position in a range / cell while mouse moves ?

Thank you in advance,

Regards,

RR
 
T

Tom Ogilvy

Here is code by Patrick Malloy that shows it every second:

Option Explicit
Global bShowPos As Boolean
Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long
Type POINTAPI
X As Long
Y As Long
End Type
Sub start_timer()
bShowPos = True
Application.OnTime Now + _
TimeValue("0:00:01"), "ShowPos"
End Sub
Sub ShowPos()
Dim lRetVal As Long
Dim Pos As POINTAPI
lRetVal = GetCursorPos(Pos)
Application.StatusBar = Pos.X & ", " & Pos.Y
Range("A1") = Pos.X & ", " & Pos.Y
If bShowPos Then
start_timer
Else
Application.StatusBar = False
End If
End Sub
Sub Stop_Timer()
bShowPos = False
End Sub

--
Regards,
Tom Ogilvy

Regina Rodler said:
Thank you Paul,

but what I need is a continuous display of coordinates of actual
coordinate-values whenever mouse is moved.

RR

Paul B said:
Regina, here is one way, right click on the worksheet tab and view code,
paste this in the window that opens
will put the cell address in A1, change to the cell you want

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
[A1] = ActiveCell.Address
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

Regina Rodler said:
Hello there,

is it possible, and if so, how, to show X- and Y-coordinates
of the cursor position in a range / cell while mouse moves ?

Thank you in advance,

Regards,

RR
 
T

Tom Ogilvy

This code by Bob Phillips would be more responsive:
http://groups.google.co.uk/groups?hl=en&lr=&selm=#[email protected]

--
Regards,
Tom Ogilvy

Tom Ogilvy said:
Here is code by Patrick Malloy that shows it every second:

Option Explicit
Global bShowPos As Boolean
Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long
Type POINTAPI
X As Long
Y As Long
End Type
Sub start_timer()
bShowPos = True
Application.OnTime Now + _
TimeValue("0:00:01"), "ShowPos"
End Sub
Sub ShowPos()
Dim lRetVal As Long
Dim Pos As POINTAPI
lRetVal = GetCursorPos(Pos)
Application.StatusBar = Pos.X & ", " & Pos.Y
Range("A1") = Pos.X & ", " & Pos.Y
If bShowPos Then
start_timer
Else
Application.StatusBar = False
End If
End Sub
Sub Stop_Timer()
bShowPos = False
End Sub

--
Regards,
Tom Ogilvy

Regina Rodler said:
Thank you Paul,

but what I need is a continuous display of coordinates of actual
coordinate-values whenever mouse is moved.

RR

Paul B said:
Regina, here is one way, right click on the worksheet tab and view code,
paste this in the window that opens
will put the cell address in A1, change to the cell you want

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
[A1] = ActiveCell.Address
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

Hello there,

is it possible, and if so, how, to show X- and Y-coordinates
of the cursor position in a range / cell while mouse moves ?

Thank you in advance,

Regards,

RR
 
R

Regina Rodler

Thank you, Tom !

RR

Tom Ogilvy said:
This code by Bob Phillips would be more responsive:
http://groups.google.co.uk/groups?hl=en&lr=&selm=#[email protected]

--
Regards,
Tom Ogilvy

Tom Ogilvy said:
Here is code by Patrick Malloy that shows it every second:

Option Explicit
Global bShowPos As Boolean
Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long
Type POINTAPI
X As Long
Y As Long
End Type
Sub start_timer()
bShowPos = True
Application.OnTime Now + _
TimeValue("0:00:01"), "ShowPos"
End Sub
Sub ShowPos()
Dim lRetVal As Long
Dim Pos As POINTAPI
lRetVal = GetCursorPos(Pos)
Application.StatusBar = Pos.X & ", " & Pos.Y
Range("A1") = Pos.X & ", " & Pos.Y
If bShowPos Then
start_timer
Else
Application.StatusBar = False
End If
End Sub
Sub Stop_Timer()
bShowPos = False
End Sub

--
Regards,
Tom Ogilvy

Regina Rodler said:
Thank you Paul,

but what I need is a continuous display of coordinates of actual
coordinate-values whenever mouse is moved.

RR

Regina, here is one way, right click on the worksheet tab and view code,
paste this in the window that opens
will put the cell address in A1, change to the cell you want

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
[A1] = ActiveCell.Address
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

Hello there,

is it possible, and if so, how, to show X- and Y-coordinates
of the cursor position in a range / cell while mouse moves ?

Thank you in advance,

Regards,

RR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top