Union Method [Excel 2003 VBA Language Reference]

Returns the union of two or more ranges.

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

expression Optional. An expression that returns an Application object.

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


This example fills the union of two named ranges, Range1 and Range2, with the formula =RAND().

Set bigRange = Application.Union(Range("Range1"), Range("Range2"))
bigRange.Formula = "=RAND()"

Applies to | Application Object

See Also | Intersect Method | Referring to Multiple Ranges | Referring to Rows and Columns