ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formula to show cursor's whereabouts (https://www.excelbanter.com/excel-programming/323279-formula-show-cursors-whereabouts.html)

Manunc

Formula to show cursor's whereabouts
 

: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".


--
Manunc
------------------------------------------------------------------------
Manunc's Profile: http://www.excelforum.com/member.php...o&userid=19917
View this thread: http://www.excelforum.com/showthread...hreadid=345842


gocush[_29_]

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:


: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".


--
Manunc
------------------------------------------------------------------------
Manunc's Profile: http://www.excelforum.com/member.php...o&userid=19917
View this thread: http://www.excelforum.com/showthread...hreadid=345842



Manunc[_2_]

Formula to show cursor's whereabouts
 

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


gocush[_29_]

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



Manunc[_3_]

Formula to show cursor's whereabouts
 

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

--
Manun
-----------------------------------------------------------------------
Manunc's Profile: http://www.excelforum.com/member.php...fo&userid=1991
View this thread: http://www.excelforum.com/showthread.php?threadid=34584


Manunc[_4_]

Formula to show cursor's whereabouts
 

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.


--
Manunc
------------------------------------------------------------------------
Manunc's Profile: http://www.excelforum.com/member.php...o&userid=19917
View this thread: http://www.excelforum.com/showthread...hreadid=345842



All times are GMT +1. The time now is 05:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com