Moves the worksheet to another location within the workbook’s collection of worksheets.
An integer value specifying the zero-based destination index of the moved worksheet.
When you move worksheets in the document, a hidden worksheet can occupy the position of the currently active worksheet. In this case, the next visible worksheet to the right of this hidden worksheet will be automatically activated. If there are no visible worksheets to the right of the hidden worksheet, the first visible worksheet to the left of this worksheet becomes active.
This example demonstrates how to move a worksheet to another location in a workbook. To do this, call the Worksheet.Move method and pass the worksheet zero-based index specifying the position in the WorksheetCollection collection into which the worksheet should be moved.
// Move the first worksheet to the position of the last worksheet within the workbook. workbook.Worksheets.Move(workbook.Worksheets.Count - 1);
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Move(Int32) method.
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.