开发者

Comparing Ranges in Excel

In the Excel Interop libraries, is there functionality to determine whether a given Range object is contained within another Range object?

It would be simple enough for me to compare the row and column indic开发者_如何学Pythones of each Range, but things become more complicated when you want to compare two ranges that may be on different worksheets.


Application.Intersect will do the job.

It will give you a Range that is the intersection of two ranges A and B

If Range A is contained in Range B, then the result will have the same width and height as A.

The result will be null / Nothing if the ranges don't intersect at all.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜