Note

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

Access to this page requires authorization. You can try .

ExcelScript.HorizontalAlignment enum

Package:
ExcelScript

Remarks

Used by

Examples

/**
 * This script centers the text in a table's header row cells.
 */
function main(workbook: ExcelScript.Workbook) {
 // Get the first table on the current worksheet.
 const currentSheet = workbook.getActiveWorksheet();
 const table = currentSheet.getTables()[0];

 // Get the header range.
 const headerRange = table.getHeaderRowRange();

 // Set the horizontal text alignment to `center`.
 headerRange.getFormat().setHorizontalAlignment(ExcelScript.HorizontalAlignment.center);
}

Fields

center
centerAcrossSelection
distributed
fill
general
justify
left
right

Feedback

Was this page helpful?