Using the Union Method to Join Multiple Ranges

The Union Method enables you to join two or more non-contiguous ranges. It creates a temporary object of the multiple ranges, allowing you to affect them together:

Application.Union(argument7, argument2, etc.)

Using the isEmpty Function to Check Whether a Cell Is Empty 69

The following code joins two named ranges on the sheet, inserts the =RAND() formulas, and bolds them:

Set UnionRange = Union(Range("Range1"), Range("Range2")) With UnionRange

.Formula = "=RAND()" .Font.Bold = True End With

0 0

Post a comment