MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Is a specific cell contained in the current range?


Posted by JAF on April 28, 2000 1:57 AM

I need some code that will return a value of TRUE if a specified cell (say C6) is EITHER the current selection OR is part of the current range.

If C6 is NOT either the current selection or part of the current range, then FALSE should be returned.

Any suggestions?


Posted by Celia on April 28, 2000 2:40 AM


JAF

If Intersect(Range("C6"), Selection) Is Nothing Then
MsgBox "False"
Else
MsgBox "True"
End If

Celia

Posted by JAF on April 28, 2000 8:43 AM

Thanks Celia - you're a life saver.