Worksheet.CopyFrom(Worksheet) Method
Copies the specified worksheet into the current instance.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v20.2.Core.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
source | Worksheet | A Worksheet object that specifies the source worksheet for copying. |
Examples
This example demonstrates how to create a copy of an existing worksheet. To do this, follow the steps below.
- Create an empty worksheet in a workbook. For example, call the WorksheetCollection.Add method.
- Access the newly created worksheet object and call its Worksheet.CopyFrom method with the source worksheet object passed as a parameter.
// Add a new worksheet to a workbook.
workbook.Worksheets.Add("Sheet1_Copy");
// Copy all information (content and formatting) to the newly created worksheet
// from the "Sheet1" worksheet.
workbook.Worksheets["Sheet1_Copy"].CopyFrom(workbook.Worksheets["Sheet1"]);
See Also
Feedback