On Mon, 21 Jul 2008 15:08:02 -0400,
(E-Mail Removed)
wrote:
>Why doesn't this work?
>
>Straight from the microsoft site, or the help files for
>Application.Intersect
>
>Worksheets("Sheet1").Activate
>Set isect = Application.Intersect(Range("rg1"), Range("rg2"))
>If isect Is Nothing Then
> MsgBox "Ranges do not intersect"
>Else
> isect.Select
>End If
>
>I opened a new workbook, named two ranges which must intersect per the
>procedure, and it displays the messagebox every time. Doesn't matter
>if there's a value in the intersected cell or not.
Did you really manage to name the ranges to "rg1" and "rg2"?
I think "rg1" and "rg2" are not valid range name as they conflict with
the cells with the same name.
It you use e.g. "rg_1" and "rg_2" for the range names the result will
be as expected.
Hope this helps. / Lars-Åke