[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorksheet.Copy

Copy Method

Copy(IWorkbook)

Copies the sheet to the end of the specified workbook.

The copied sheet is appended to the destination workbook and returned as a new worksheet instance. If null is specified, the sheet is copied to the end of the current workbook.

Declaration
IWorksheet Copy(IWorkbook workbook = null)
Function Copy(Optional workbook As IWorkbook = Nothing) As IWorksheet
Parameters
Type Name Description
IWorkbook workbook

The workbook to which the sheet will be copied, or null to copy the sheet to the end of the current workbook.

Returns
Type Description
IWorksheet

The newly copied worksheet.

Examples
worksheet.Name = "Report";
worksheet.Range["A1:B2"].Value = new object[,] {
    {"Name", "Value"},
    {"Test", 100}
};
IWorkbook targetWorkbook = new Workbook();
IWorksheet copiedSheet = worksheet.Copy(targetWorkbook);
copiedSheet.Name = "Report Copy";