Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

how to find out if a c ell is inside a range

  Asked By: Dale    Date: Dec 06    Category: MS Office    Views: 772
  

Is there any "elegant" solution to know if a single cell is inside a
range, other than looping through the whole range and comparing each
single cell?
I need it for the BeforeDoubleClick event to know if the cell which
was double clicked is in certain range on my sheet.
I couldn't find any methods or properties in VBA help files that would
do that...

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Kathleen Adams     Answered On: Dec 06



Try the Intersect() function. For example:

if Intersect(Range("A1:C10"), Range("B3")) then
.....
endif

 
Didn't find what you were looking for? Find more on how to find out if a c ell is inside a range Or get search suggestion and latest updates.




Tagged: