How do i assign cell A1 to show the current cursor cell in Excel?

O

OB

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.
 
G

Gary''s Student

Put the following in worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Value = Target.Address
End Sub
 
J

Jim May

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
 
Top