Wednesday, August 30, 2023

Google App script to wrap text

If you want to wrap text or want to check whether text is wrapped or not, we have below function 

getWrap() tells whether the text in the cell is wrapped or not.

setWrap() sets the cell wrap for a single cell.

Example: This will wrap single text box

SpreadsheetApp.getActiveSheet().getRange("A1").setWrap(true);

To check or set wrap to range of text:

getWraps() : whether the cells in a range are wrapped or not.

setWraps() : applies a rectangular grid of word wrap policies to a range.