简体   繁体   中英

Given 2 named ranges, set operations in VBA excel

Let's suppose that you are considering 2 named ranges, A and B.

In VBA Excel, are there built in functions to ask questions like:

  1. Is one range entirely contained in another?
  2. If the 2 named ranges are not mutually exclusive, what is the range that is inside A but not B, vice versa?

Basically, set operations related functionality....

Out of the box you have Application.Union and .Intersect , which do more or less what you'd expect when provided two ranges.

For anything else you will need to code something up, or search for something someone has already provided, such as the "Difference" post here - Non-Intersect Range VBA

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM