Copy Rows and Columns

Copying Rows

Copying Single Row

The following example shows how to copy a single row in a worksheet. The example uses a Microsoft Excel spreadsheet as input and copies the first row to the next 10 rows in the same worksheet.

Copying Multiple Rows

You can also copy multiple rows onto a new destination while using the Cells.CopyRows method which takes an additional parameter of type integer to specify the number of source rows to be copied.

Copying Columns

Copying Single Column

The following example shows how to copy a column in a worksheet. This example uses an existing spreadsheet as input to the process and copies the first column to the next 10 columns using two different approaches.

Copying Multiple Columns

Similar to Cells.CopyRows method, the Aspose.Cells APIs also provide the Cells.CopyColumns method in order to copy multiple source columns to a new location.