[]
Moves the sheet to the location before the specified sheet.
The target sheet can belong to the same workbook or a different workbook.
IWorksheet MoveBefore(IWorksheet targetSheet)
Function MoveBefore(targetSheet As IWorksheet) As IWorksheet
| Type | Name | Description |
|---|---|---|
| IWorksheet | targetSheet | The sheet before 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 = "Data";
IWorksheet summarySheet = workbook.Worksheets.Add();
summarySheet.Name = "Summary";
IWorksheet movedSheet = summarySheet.MoveBefore(worksheet);