Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ExcelScript.InsertShiftDirection enum

Package:
ExcelScript

Determines the direction in which existing cells will be shifted to accommodate what is being inserted.

Remarks

Used by

Examples

/**
 * This script inserts headers at the top of the worksheet.
 */
function main(workbook: ExcelScript.Workbook)
{
 let currentSheet = workbook.getActiveWorksheet();

 // Create headers for 3 columns.
 let myHeaders = [["NAME", "ID", "ROLE"]];

 // Add a blank first row and push existing data down a row.
 let firstRow = currentSheet.getRange("1:1");
 firstRow.insert(ExcelScript.InsertShiftDirection.down);

 // Add the headers.
 currentSheet.getRange("A1:C1").setValues(myHeaders);
}

Fields

down
right

Feedback

Was this page helpful?