Home > Articles > Home & Office Computing > Microsoft Applications

This chapter is from the book

Using the Intersect Method to Create a New Range from Overlapping Ranges

The Intersect method returns the cells that overlap between two or more ranges:

Application.Intersect(argument1, argument2, etc.)

The following code colors the overlapping cells of the two ranges, as shown in Figure 3.4:

Set IntersectRange = Intersect(Range("Range1"), Range("Range2"))
IntersectRange.Interior.ColorIndex = 6

Figure 3.4Figure 3.4 The Intersect method returns overlapping cells.




  • + 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