Union and Intersect in Excel VBA
The Union method in Excel VBA returns a Range object that represents the union of two or more ranges (borders below for illustration only).
Code line:
Result:
Note: the Union method doesn't return the mathematical union (cell C6 and cell C7 are included twice).
The Intersect method in Excel VBA returns a Range object that represents the intersection of two or more ranges (borders below for illustration only).
Code line:
Result:
If you're new here, welcome to Excel Easy! Join over 1 million monthly Excel learners. You can find popular courses here: Data Analysis in Excel and Excel VBA.