[]
Moves the sheet collection to the location before the specified sheet.
IWorksheets MoveBefore(IWorksheet targetSheet)
Function MoveBefore(targetSheet As IWorksheet) As IWorksheets
| Type | Name | Description |
|---|---|---|
| IWorksheet | targetSheet | The sheet before which the moved sheet collection will be placed. It can be the sheet of the same or another workbook. |
| Type | Description |
|---|---|
| IWorksheets | The moved sheet collection. |
workbook.Worksheets.Add().Name = "Summary";
IWorksheets sheets = workbook.Worksheets[new string[] { "Sheet1", "Summary" }];
IWorksheet targetSheet = workbook.Worksheets.Add();
IWorksheets movedSheets = sheets.MoveBefore(targetSheet);