Formula to show cursor's whereabouts

  • Thread starter Thread starter Manunc
  • Start date Start date
M

Manunc

:cool:
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".
 
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
 
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.
 
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
 
I already pasted and saved it. Then how do I use this new function?
tried to input in a cell =Worksheet_SelectionChange() but I go
#NAME
 
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.
 

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

Back
Top