Complete the code to set the horizontal alignment of cell A1 to center.
SpreadsheetApp.getActiveSheet().getRange('A1').setHorizontalAlignment([1]);
To center-align text horizontally in a cell, use setHorizontalAlignment("center").
Complete the code to enable text wrapping in cell B2.
SpreadsheetApp.getActiveSheet().getRange('B2').setWrap([1]);
Text wrapping is enabled by passing the boolean true to setWrap().
Fix the error in the code to set vertical alignment of cell C3 to bottom.
SpreadsheetApp.getActiveSheet().getRange('C3').setVerticalAlignment([1]);
The alignment value must be a string in quotes. Use "bottom" to align text vertically at the bottom.
Fill both blanks to set cell D4 text to wrap and align horizontally to right.
var range = SpreadsheetApp.getActiveSheet().getRange('D4'); range.setWrap([1]); range.setHorizontalAlignment([2]);
Use true to enable wrapping and "right" to align text to the right horizontally.
Fill all three blanks to set cell E5 text to wrap, vertical alignment to middle, and horizontal alignment to center.
var cell = SpreadsheetApp.getActiveSheet().getRange('E5'); cell.setWrap([1]); cell.setVerticalAlignment([2]); cell.setHorizontalAlignment([3]);
Enable wrapping with true, set vertical alignment to "middle", and horizontal alignment to "center".