Copy Ranges of Excel

Introduction

In Excel, you can select a range, copy the range, then paste it with specific options to the same worksheet, other worksheets, or other files.

Copy Ranges Using Aspose.Cells for Python Excel Library

Aspose.Cells for Python via .NET provides several overloads of the Range.copy method to copy a range. The Range.copy_style method copies only the style of the range, and the Range.copy_data method copies only the values of the range.

Copy Range

Create two ranges: the source range and the target range, then copy the source range to the target range using the Range.copy method.

See the following code:

Paste Range With Options

Aspose.Cells for Python via .NET supports pasting the range with specific types.

Only Copy Data Of The Range

You can also copy the data using the Range.copy_data method, as shown in the following code:

Advanced Topics