Move Range of Cells in a Worksheet

How to Move Range of Cells in a Worksheet

The example code uses a template file to demonstrate the task.

The input file

todo:image_alt_text

Please see the following generated file with range A1:B5 moved to C1:D5.

The output file

todo:image_alt_text

Sample Code

from aspose.cells import Workbook
# Instantiate the workbook object. Open the Excel file
workbook = Workbook("book1.xlsx")
cells = workbook.worksheets[0].cells
range = cells.create_range("A1", "B5")
# move the range to right.
range.move_to(0, 2)