Active Cells

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I note from a previous post that an active cell's reference can be displayed
by inserting some code, as follows:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Value = Cells(Target.Row, Target.Column).Address(False, False)
End Sub

If I wish to show only the Active Cell's line number, how should this code
be changed? Does inserting code like this mess up the Undo function?
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Value = Target.Row
End Sub
 
Steve,

If by line you mean row then try this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Value = Target.Row
End Sub
Does inserting code like this mess up the Undo function?

Yes

Mike
 
Many thanks..problem sorted!

Mike H said:
Steve,

If by line you mean row then try this

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


Yes

Mike
 
Back
Top