[]
Specifies the type of content to paste during a range copy operation.
Used with Copy(IRange, PasteOption) or
PasteType to control which
aspects of the source range are pasted to the destination.
Multiple values can be combined using bitwise OR (e.g., PasteType.Values | PasteType.Formats).
[Flags]
public enum PasteType
<Flags>
Public Enum PasteType
worksheet.Range["A1:B2"].Value = new object[,] {
{"Name", "Price"},
{"Apple", 1.99}
};
worksheet.Range["A1:B1"].Font.Bold = true;
worksheet.Range["A1:B2"].Copy(worksheet.Range["D1"], new PasteOption { PasteType = PasteType.Values });
| Name | Description |
|---|---|
| ColumnWidths | Specifies to only paste column widths. |
| Default | Specifies to paste all data except RowHeights and ColumnWidths. |
| Formats | Specifies to only paste formats. |
| Formulas | Specifies to only paste cell formulas. |
| NumberFormats | Specifies to only paste number formats. |
| RowHeights | Specifies to only paste row heights. |
| Values | Specifies to only paste cell values. |