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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Put the following in worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Value = Target.Address
End Sub
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top