ExcelScript.GroupOption enum
Remarks
Examples
/**
* This script creates a two-level column-based outline on Sheet1.
*/
function main(workbook: ExcelScript.Workbook) {
// Group columns A-F in the worksheet named Sheet1.
const sheet = workbook.getWorksheet("Sheet1");
const firstLevel = sheet.getRange("A:F");
firstLevel.group(ExcelScript.GroupOption.byColumns);
// Create a second level to the outline by grouping subsections.
sheet.getRange("A:B").group(ExcelScript.GroupOption.byColumns);
sheet.getRange("D:E").group(ExcelScript.GroupOption.byColumns);
}
Fields
byColumns | Group by columns. |
byRows | Group by rows. |
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