Page tree
Skip to end of metadata
Go to start of metadata

Description

Copies an area of cells from a Worksheet in either the same workbook or another workbook.
You may specify the types of data copied (cell value, formulas, comments, formatting, etc.) using the CopyPasteProperties object.
The CopyPaste method supports copying column width, comments, formulas, merged cells, row height, values, and cell and number formatting.The CopyPaste method does not currently support copying anything not listed above, including charts, images, or autofilters.

C#
vb.net

Parameters

firstRow
The zero-based index of the first row in destination area.
firstCol
The zero-based index of the first column in the destination area.
sourceArea
An area from the source workbook from which to copy.
properties
A CopyPasteProperties object that specifies the types of data to copy.

Returns

An Area object representing the set of cells populated with the copied values.

Remarks

  • The copied data will overwrite the contents of the cells in this worksheet.
  • The CopyPaste method does not copy conditional formatting.
  • When formulas are copied, references to ranges are updated to refer to the new sheet.

Examples

C#
vb.net
  • No labels