Reputation: 468
I have some VBA code that displays the row and column number of the active cell in the respective named ranges: State_Row and State_Column.
Public Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet1.Range("State_Row").Value = ActiveCell.Row
Sheet1.Range("State_Column").Value = ActiveCell.Column
End Sub
This works fine, however, I want it to only apply to the range D10:E65, so if the user clicks outside this range, the row and column numbers do not update.
Upvotes: 0
Views: 282