ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do I insert the address of a selected cell into a fixed cell (https://www.excelbanter.com/excel-discussion-misc-queries/90905-how-do-i-insert-address-selected-cell-into-fixed-cell.html)

cox

how do I insert the address of a selected cell into a fixed cell
 
Any time I click mouse on a cell, the address of cell is needed to appear on
a fixed cell say a1. In other words if I click the mouse on cell b5 say, the
content of the cell should be "b5". How do I do this?

bgeier

how do I insert the address of a selected cell into a fixed cell
 

This should do it for you

Code:
--------------------

Private Sub Worksheet_selectionChange(ByVal Target As Range)
Application.Volatile
Cells(1, 1) = Target.AddressLocal
End Sub

--------------------


--
bgeier
------------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822
View this thread: http://www.excelforum.com/showthread...hreadid=546128


cox

how do I insert the address of a selected cell into a fixed ce
 
Thanks a lot - appreciate your help


"bgeier" wrote:


This should do it for you

Code:
--------------------

Private Sub Worksheet_selectionChange(ByVal Target As Range)
Application.Volatile
Cells(1, 1) = Target.AddressLocal
End Sub

--------------------


--
bgeier
------------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822
View this thread: http://www.excelforum.com/showthread...hreadid=546128




All times are GMT +1. The time now is 10:58 PM.

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