+ Reply to Thread
Results 1 to 6 of 6

Formula to show cursor's whereabouts

  1. #1
    Registered User
    Join Date
    02-14-2005
    Posts
    6

    Formula to show cursor's whereabouts


    Can anybody tell me what is the formula/function to define into a cell, to show result of a cursor's location/whereabouts?

    Example: If I move the cursor to cell B2, then the formula (let's say at cell A1) should return "B2". If I move the cursor up 1 cell to B1, then A1 should show "B1".

  2. #2
    gocush
    Guest

    RE: Formula to show cursor's whereabouts

    The cursor (the arrow) is not the same as the activecell, since you can and
    usually do move your cursor around the screen while the active cell remains
    unchanged. That being said, it sounds like what you want is to know which
    cell is the currently ActiveCell. The following code will place the address
    of the activecell (or the upper left cell of a selected range) in Range A1
    and will update whenever a new cell is selected.

    This code goes in the Sheet Object of whichever sheet you want. Write back
    if you need help finding where it goes.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Range("A1") = Target.cells(1).Address
    End Sub

    "Manunc" wrote:

    >
    >
    > Can anybody tell me what is the formula/function to define into a cell,
    > to show result of a cursor's location/whereabouts?
    >
    > Example: If I move the cursor to cell B2, then the formula (let's say
    > at cell A1) should return "B2". If I move the cursor up 1 cell to B1,
    > then A1 should show "B1".
    >
    >
    > --
    > Manunc
    > ------------------------------------------------------------------------
    > Manunc's Profile: http://www.excelforum.com/member.php...o&userid=19917
    > View this thread: http://www.excelforum.com/showthread...hreadid=345842
    >
    >


  3. #3
    Registered User
    Join Date
    02-14-2005
    Posts
    6
    Thanks alot Gocush.

    You're quite correct, Active Cell is what I've been meaning, not Cursor.

    Could you please tell me where to place the subroutine that you gave me? I haven't tried this kind before.

  4. #4
    gocush
    Guest

    Re: Formula to show cursor's whereabouts

    Copy the code lines from my above post
    Activate the sheet you want to use.
    Right click on the Sheet TAB (at the bottom of screen)
    click on > View Code
    Paste code

    "Manunc" wrote:

    >
    > Thanks alot Gocush.
    >
    > You're quite correct, Active Cell is what I've been meaning, not
    > Cursor.
    >
    > Could you please tell me where to place the subroutine that you gave
    > me? I haven't tried this kind before.
    >
    >
    > --
    > Manunc
    > ------------------------------------------------------------------------
    > Manunc's Profile: http://www.excelforum.com/member.php...o&userid=19917
    > View this thread: http://www.excelforum.com/showthread...hreadid=345842
    >
    >


  5. #5
    Registered User
    Join Date
    02-14-2005
    Posts
    6
    I already pasted and saved it. Then how do I use this new function? I tried to input in a cell =Worksheet_SelectionChange() but I got #NAME?

  6. #6
    Registered User
    Join Date
    02-14-2005
    Posts
    6
    Wow Gocush! I just noticed something at A1. Cooool! I think I've got it, thanks to you! I thought I had to call this function everytime.

+ 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