[]
Moves the sheet to the location after the specified sheet.
The target sheet can belong to the same workbook or another workbook.
IWorksheet MoveAfter(IWorksheet targetSheet)
Function MoveAfter(targetSheet As IWorksheet) As IWorksheet
| Type | Name | Description |
|---|---|---|
| IWorksheet | targetSheet | The sheet after which the moved sheet will be placed. It can be the sheet of the same or another workbook. |
| Type | Description |
|---|---|
| IWorksheet | The moved sheet. |
worksheet.Name = "Summary";
IWorksheet detailsSheet = workbook.Worksheets.Add();
detailsSheet.Name = "Details";
IWorksheet movedSheet = worksheet.MoveAfter(detailsSheet);