Home > Articles > Home & Office Computing > Microsoft Applications

This chapter is from the book

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(argument1, argument2, etc.)

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
  • + Share This
  • 🔖 Save To Your Account
VBA and Macros for Microsoft Excel

This chapter is from the book

VBA and Macros for Microsoft Excel

Discussions

comments powered by Disqus