I think I have seen an elegant way of determining if a particular cell lies
within a particular range. eg. does cell(x,y) lie inside range(a:b)
Any ideas?
Thanks, Kaval
I think I have seen an elegant way of determining if a particular cell lies
within a particular range. eg. does cell(x,y) lie inside range(a:b)
Any ideas?
Thanks, Kaval
Kaval,
MsgBox Not (Intersect(Cells(x, y), Range("a:b")) Is Nothing)
HTH,
Bernie
MS Excel MVP
"Kaval" <[email protected]> wrote in message
news:[email protected]...
>I think I have seen an elegant way of determining if a particular cell lies
> within a particular range. eg. does cell(x,y) lie inside range(a:b)
>
> Any ideas?
>
> Thanks, Kaval
Hi Kaval,
Try something like:
Sub Tester09()
Dim rng As Range
Dim rcell As Range
Set rng = Range("TEST")
Set rcell = Range("A2")
If Not Intersect(rcell, rng) Is Nothing Then
MsgBox rcell.Address(0, 0) & " lies in the named " _
& rng.Name.Name & " range"
Else
'It does not!
End If
End Sub
---
Regards,
Norman
"Kaval" <[email protected]> wrote in message
news:[email protected]...
>I think I have seen an elegant way of determining if a particular cell lies
> within a particular range. eg. does cell(x,y) lie inside range(a:b)
>
> Any ideas?
>
> Thanks, Kaval
For example:
MsgBox Not Intersect (Range("A1"), Range("A2:Z100")) Is Nothing
--
Vasant
"Kaval" <[email protected]> wrote in message
news:[email protected]...
> I think I have seen an elegant way of determining if a particular cell
lies
> within a particular range. eg. does cell(x,y) lie inside range(a:b)
>
> Any ideas?
>
> Thanks, Kaval
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks