Skip to main content

Text Alignment and Line Breaks

APIDescriptionExample
Range.HorizontalAlignmentProperty that returns or changes the horizontal alignment state of text for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.HorizontalAlignment);
range.HorizontalAlignment = instance.Enums.XlHAlign.xlHAlignCenter;
Range.VerticalAlignmentProperty that returns or changes the vertical alignment state of text for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.VerticalAlignment);
range.VerticalAlignment = instance.Enums.XlVAlign.xlVAlignBottom;
Range.RowHeightProperty that returns or changes the row height for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.RowHeight);
range.RowHeight = 10;
Range.ColumnWidthProperty that returns or changes the column width for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.ColumnWidth);
range.ColumnWidth = 10;
Range.WrapTextProperty that returns or changes the text wrapping state for the specified rangelet range = instance.Application.ActiveSheet.Range("A1");

console.log(range.WrapText);
range.WrapText = true;

Format Management , Font Style , Cell Background Color and Border , Conditional Formatting , Custom Formatting , Formatting Rendering Overview