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

Aspose.Cells provides several overloaded Range.Copy methods to copy a 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 supports pasting the range with a specific paste type.

Copy Only the Data of the Range

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