intersect方法

intersect

返回一个 Range 对象,该对象表示两个范围的矩形交集。

退货

返回 Range 对象

def intersect(self, range):
    ...
范围类型描述
rangeRange相交范围。

评论

如果两个范围不相交,则返回 null。

例子

from aspose.cells import Workbook

# Instantiating a Workbook object
workbook = Workbook()
#  Get the first Worksheet Cells.
cells = workbook.worksheets[0].cells
range1 = cells.create_range("A1:A5")
range2 = cells.create_range("A3:A10")
# Get intersected range of the two ranges.
intersectRange = range1.intersect(range2)
# Save the Excel file
workbook.save("book1.xlsm")

也可以看看