![]() |
how do I get the current cursor position in a spreedsheet
I'm wanting to use the current cursor position in a formula but have looked
at all the possibles like ROW, CELL, INFO with no luck.... but yet I can see it right there in the NAME BOX... just can't get at it !!!! |
how do I get the current cursor position in a spreedsheet
Hi Paul J
Selection.Column will give you the column number of the selected cell Selection.Row will give the row number ActiveCell.Address will give the absolute cell address i.e. "$A$1" "Paul J" <Paul wrote in message ... I'm wanting to use the current cursor position in a formula but have looked at all the possibles like ROW, CELL, INFO with no luck.... but yet I can see it right there in the NAME BOX... just can't get at it !!!! |
how do I get the current cursor position in a spreedsheet
The closest standard function that gives what you ask is the Cell function.
However, it only updates when there is a change in the worksheet that triggers a recalc, not when the cursor position changes. =Cell("Address") This will return the address of the active cell when a recalc takes place. When you enter data or press F9, for example. You could also write your own function in VBA code that uses ActiveCell.Address to return the cursor address. However, you would need to declare the function Volatile and it also would only update on a recalc. The only way to trap the cursor address when it changes is to write code for the SelectionChange event. "Paul J" <Paul wrote in message ... I'm wanting to use the current cursor position in a formula but have looked at all the possibles like ROW, CELL, INFO with no luck.... but yet I can see it right there in the NAME BOX... just can't get at it !!!! |
how do I get the current cursor position in a spreedsheet
Ah... just tried it... also had to learn VB to do it !!!
unfortunately I wanted somthing that would continue to update as I move the cursor around :( "bigwheel" wrote: Hi Paul J Selection.Column will give you the column number of the selected cell Selection.Row will give the row number ActiveCell.Address will give the absolute cell address i.e. "$A$1" "Paul J" <Paul wrote in message ... I'm wanting to use the current cursor position in a formula but have looked at all the possibles like ROW, CELL, INFO with no luck.... but yet I can see it right there in the NAME BOX... just can't get at it !!!! |
how do I get the current cursor position in a spreedsheet
thank you both for your replies... it's appreciated.
"John Green" wrote: The closest standard function that gives what you ask is the Cell function. However, it only updates when there is a change in the worksheet that triggers a recalc, not when the cursor position changes. =Cell("Address") This will return the address of the active cell when a recalc takes place. When you enter data or press F9, for example. You could also write your own function in VBA code that uses ActiveCell.Address to return the cursor address. However, you would need to declare the function Volatile and it also would only update on a recalc. The only way to trap the cursor address when it changes is to write code for the SelectionChange event. "Paul J" <Paul wrote in message ... I'm wanting to use the current cursor position in a formula but have looked at all the possibles like ROW, CELL, INFO with no luck.... but yet I can see it right there in the NAME BOX... just can't get at it !!!! |
All times are GMT +1. The time now is 08:37 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com