How do i assign cell A1 to show the current cursor cell in Excel?
I am trying to dynamically get the current cell address or the contents of
that cell in to one fixed cell (cell A1). When I move the cursor within the worksheet, I would like the value of the cell A1 to reflect the new position of the cursor cell (cell address) or the contents of that cell. |
How do i assign cell A1 to show the current cursor cell in Excel?
Put the following in worksheet code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Range("A1").Value = Target.Address End Sub -- Gary's Student "OB" wrote: I am trying to dynamically get the current cell address or the contents of that cell in to one fixed cell (cell A1). When I move the cursor within the worksheet, I would like the value of the cell A1 to reflect the new position of the cursor cell (cell address) or the contents of that cell. |
How do i assign cell A1 to show the current cursor cell in Excel?
Paste this into the Sheet Module of the sheet in question:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Range("A1") = Cells(Target.Row, Target.Column).Address(0, 0) End Sub You may also want to do a Freeze Pane in Cell A2; HTH "OB" wrote: I am trying to dynamically get the current cell address or the contents of that cell in to one fixed cell (cell A1). When I move the cursor within the worksheet, I would like the value of the cell A1 to reflect the new position of the cursor cell (cell address) or the contents of that cell. |
All times are GMT +1. The time now is 02:16 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com