ExcelScript.WorksheetPositionType enum
The position of a worksheet relative to another worksheet or the entire worksheet collection.
Remarks
Examples
/**
* This script duplicates a worksheet named "Template".
* The new worksheet is added after the template.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the worksheet named "Template".
let template = workbook.getWorksheet("Template");
// Copy the worksheet.
let newSheet = template.copy(
ExcelScript.WorksheetPositionType.after,
template
);
// Name the worksheet using the current date.
let date = new Date(Date.now());
newSheet.setName(`${date.toDateString()}`);
}
Fields
after | |
before | |
beginning | |
end | |
none |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Scripts