Application.Union (Excel)

Returns the union of two or more ranges.

Union (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30)

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

Arguments

The following arguments are required:

Arg1 (Range) - At least two Range objects must be specified.

Arg2 (Range) - At least two Range objects must be specified.

The following arguments are optional

Arg3

Arg4

Arg5

Arg6

Arg7

Arg8

Arg9

Arg10

Arg11

Arg12

Arg13

Arg14

Arg15

Arg16

Arg17

Arg18

Arg19

Arg20

Arg21

Arg22

Arg23

Arg24

Arg25

Arg26

Arg27

Arg28

Arg29

Arg30 - A range