[]
Copies the sheet to the location after the specified sheet.
The copied sheet is inserted immediately after targetSheet. The target sheet can belong to the current workbook or another workbook.
IWorksheet CopyAfter(IWorksheet targetSheet)
Function CopyAfter(targetSheet As IWorksheet) As IWorksheet
| Type | Name | Description |
|---|---|---|
| IWorksheet | targetSheet | The sheet after which the copied sheet will be placed. It can be a sheet in the same workbook or another workbook. |
| Type | Description |
|---|---|
| IWorksheet | The new copied sheet. |
worksheet.Name = "Data";
worksheet.Range["A1"].Value = "Name";
IWorksheet summarySheet = workbook.Worksheets.Add();
summarySheet.Name = "Summary";
IWorksheet copiedSheet = worksheet.CopyAfter(summarySheet);
copiedSheet.Name = "Data Copy";