Moving Worksheets
Contents
[
Hide
]
Aspose.Cells.GridDesktop supports moving worksheets within the workbook.
Move Worksheets within a Workbook
Aspose.Cells.GridDesktop provides a method, Aspose.Cells.GridDesktop.WorksheetCollection.MoveTo(), that is used to move a worksheet to the specified index. It takes the indexes (zero-based) of the source worksheet and destination worksheet as parameters. It is basically used to move a worksheet to another location in the same spreadsheet.
The following example shows how to move a worksheet to another location within the workbook.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Move the 2nd worksheet to 4th position. | |
gridDesktop1.Worksheets.MoveTo(1, 3); |