Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Test if ActiveCell is within a certain named range

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Test if ActiveCell is within a certain named range

if intersect(Target, Range("RangePriority") then
do something
end if

HTH
--
AP

"Steven" a écrit dans le message de
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Produce the name of the named range of activecell L. Howard Kittle Excel Programming 2 December 15th 05 12:38 AM
How to get name of named range where activecell is Tetsuya Oguma[_4_] Excel Programming 5 April 8th 05 11:13 AM
Copy named range contents to activecell position Neal Excel Programming 2 October 28th 04 02:20 PM
Finding if the activecell is withing a named range Seamus Conlon Excel Programming 8 August 28th 04 12:10 AM
easy way to test if a Named Range exists Andrew Bauer Excel Programming 4 July 10th 03 07:32 PM


All times are GMT +1. The time now is 04:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"