méthode intersect

intersect(self, range)

Renvoie un objet Range qui représente l’intersection rectangulaire de deux plages.

Retour

Renvoie un objet Range


def intersect(self, range):
    ...
ParamètreTaperDescription
rangeRangeLa gamme d’intersection.

Remarques

Si les deux plages ne sont pas intersectées, renvoie null.

Exemple

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")

Voir également