Skip to main content

Move

Moves the current sheet to another location in the workbook.

Syntax

expression.Move(before, after);

expression - A variable that represents a ApiWorksheet class.

Parameters

NameRequired/OptionalData typeDefaultDescription
beforeRequiredApiWorksheetThe sheet before which the current sheet will be placed. You cannot specify "before" if you specify "after".
afterRequiredApiWorksheetThe sheet after which the current sheet will be placed. You cannot specify "after" if you specify "before".

Returns

This method doesn't return any data.

Example

Reorder sheets by shifting one before or after another in a spreadsheet.

// Change the tab position of a sheet relative to your other sheets in a spreadsheet?

// Reorganize sheet sequence to group related data together in a spreadsheet.

let sheet1 = Api.GetActiveSheet();
Api.AddSheet("Sheet2");
let sheet2 = Api.GetActiveSheet();
sheet2.Move(sheet1);