View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Test if ActiveCell is within a certain named range

Hi Steven,

Try:

'=============
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Range("RangePriority"), Target) Is Nothing Then
MsgBox Target.Address(0, 0) _
& " intersects with the RangePriority range"
End If

End Sub
'<<=============



---
Regards,
Norman



"Steven" wrote in message
...
I have a range named "RangePriority". When I click in a cell in the
worksheet how can I test to see if it is within the range "RangePriority".

I guess it the testing would occur in:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Code Here to Test ActiveCell
End Sub

Thank you for your help.

Steven