Skip to main content
A newer version of this page is available. .

How to: Copy Worksheets within a Workbook

Important

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

This example demonstrates how to create a copy of an existing worksheet. To do this, follow the steps below.

// 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