Intersect Method [Excel 2003 VBA Language Reference]

Returns a Range object that represents the rectangular intersection of two or more ranges.

expression**.Intersect(Arg1**, Arg2, ...)

expression Optional. An expression that returns an Application object.

Arg1, Arg2, ... Required Range. The intersecting ranges. At least two Range objects must be specified.


This example selects the intersection of two named ranges, rg1 and rg2, on Sheet1. If the ranges don't intersect, the example displays a message.

Set isect = Application.Intersect(Range("rg1"), Range("rg2"))
If isect Is Nothing Then
    MsgBox "Ranges do not intersect"
End If

Applies to | Application Object

See Also | Union Method