copy method

copy

Copies data (including formulas), formatting, drawing objects etc. from a source range.

def copy(self, range):
    ...
ParameterTypeDescription
rangeRangeSource Range object.

Example

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("A6:A10")
# Copy the range.
range1.copy(range2)
# Save the Excel file
workbook.save("book1.xlsm")

copy

Copying the range with paste special options.

def copy(self, range, options):
    ...
ParameterTypeDescription
rangeRangeThe source range.
optionsPasteOptionsThe paste special options.

See Also