+ Reply to Thread
Results 1 to 8 of 8

Display cursor position in cell

  1. #1
    Regina Rodler
    Guest

    Display cursor position in cell

    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



  2. #2
    Paul B
    Guest

    Re: Display cursor position in cell

    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" <[email protected]> wrote in message
    news:%[email protected]...
    > 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
    >




  3. #3
    Regina Rodler
    Guest

    Re: Display cursor position in cell

    Thank you Paul,

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

    RR

    "Paul B" <[email protected]> schrieb im Newsbeitrag
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:%[email protected]...
    >> 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
    >>

    >
    >




  4. #4
    Regina Rodler
    Guest

    Re: Display cursor position in cell

    Thank you Paul,

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

    RR

    "Paul B" <[email protected]> schrieb im Newsbeitrag
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:%[email protected]...
    >> 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
    >>

    >
    >




  5. #5
    Tom Ogilvy
    Guest

    Re: Display cursor position in cell

    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" <[email protected]> wrote in message
    news:[email protected]...
    > Thank you Paul,
    >
    > but what I need is a continuous display of coordinates of actual
    > coordinate-values whenever mouse is moved.
    >
    > RR
    >
    > "Paul B" <[email protected]> schrieb im Newsbeitrag
    > news:[email protected]...
    > > 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" <[email protected]> wrote in message
    > > news:%[email protected]...
    > >> 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
    > >>

    > >
    > >

    >
    >




  6. #6
    Tom Ogilvy
    Guest

    Re: Display cursor position in cell

    This code by Bob Phillips would be more responsive:
    http://groups.google.co.uk/groups?hl...TNGP11.phx.gbl

    --
    Regards,
    Tom Ogilvy

    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thank you Paul,
    > >
    > > but what I need is a continuous display of coordinates of actual
    > > coordinate-values whenever mouse is moved.
    > >
    > > RR
    > >
    > > "Paul B" <[email protected]> schrieb im Newsbeitrag
    > > news:[email protected]...
    > > > 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" <[email protected]> wrote in message
    > > > news:%[email protected]...
    > > >> 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
    > > >>
    > > >
    > > >

    > >
    > >

    >
    >




  7. #7
    Regina Rodler
    Guest

    Re: Display cursor position in cell

    Thank you, Tom !

    RR

    "Tom Ogilvy" <[email protected]> schrieb im Newsbeitrag
    news:[email protected]...
    > This code by Bob Phillips would be more responsive:
    > http://groups.google.co.uk/groups?hl...TNGP11.phx.gbl
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Tom Ogilvy" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Thank you Paul,
    >> >
    >> > but what I need is a continuous display of coordinates of actual
    >> > coordinate-values whenever mouse is moved.
    >> >
    >> > RR
    >> >
    >> > "Paul B" <[email protected]> schrieb im Newsbeitrag
    >> > news:[email protected]...
    >> > > 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" <[email protected]> wrote in message
    >> > > news:%[email protected]...
    >> > >> 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
    >> > >>
    >> > >
    >> > >
    >> >
    >> >

    >>
    >>

    >
    >




  8. #8
    Registered User
    Join Date
    10-06-2015
    Location
    Grenoble, France
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: Display cursor position in cell

    Thanks Paul, this worked perfectly in order to highlight (small) column titles when I'm entering data several rows below them

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1