I am trying to create a cell that updates whenever a cell within a set range is selected. The cell will be changed to the selected cell's value. However, I am having problems with the selection change event. Here is what I have so far:
I put in the Message boxes just to troubleshoot, but I am not even getting the "Selection Changed" message box. Any idea what I am doing wrong? Also, do I have anything wrong with my code to detect if the selection is in the TEMP named range?
Eventually, I want to update a cell, say A1, to be the selected cell's value.
I am using Office 2010
Thanks!
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox "Selection Changed"
If Target.Count > 1 Then Exit Sub
If Intersect(Target.Address, Range("TEMP")) Then MsgBox "Selection is in range"
End Sub
I put in the Message boxes just to troubleshoot, but I am not even getting the "Selection Changed" message box. Any idea what I am doing wrong? Also, do I have anything wrong with my code to detect if the selection is in the TEMP named range?
Eventually, I want to update a cell, say A1, to be the selected cell's value.
I am using Office 2010
Thanks!