How to: Programmatically Move Worksheets Within Workbooks

 

You can programmatically change the position of worksheets relative to other worksheets in a workbook. If you do not specify a location for the moved sheet, Excel creates a new workbook to contain it.

Applies to: The information in this topic applies to document-level projects and VSTO add-in projects for Excel. For more information, see Features Available by Office Application and Project Type.

To move a worksheet in a document-level customization

  1. Assign the total number of sheets in the workbook to a variable and then move the first worksheet so that it becomes the last one.

    No code example is currently available or this language may not be supported.

To move a worksheet in an VSTO Add-in

  1. Assign the total number of sheets in the workbook to a variable and then move the first worksheet so that it becomes the last one.

    No code example is currently available or this language may not be supported.

Working with Worksheets
How to: Programmatically Hide Worksheets
How to: Programmatically Delete Worksheets from Workbooks
How to: Programmatically Protect Worksheets
Global Access to Objects in Office Projects

Show: