google apps scipt getRange code example
Example 1: set cell value google script
function storeValue() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var cell = sheet.getRange("B2");
cell.setValue(100);
}
Example 2: getranges google script
let SS = APP.getActiveSpreadsheet();
let sheetIndex0 = SS.getSheets()[0];
sheetIndex0.getRangeList(['A1', 'B1:C7']).setHorizontalAlignment("center");
Example 3: set cell value google script
var values = [
["2.000", "1,000,000", "$2.99"]
];
var range = sheet.getRange("B2:D2");
range.setValues(values);
Example 4: google apps scipt getRange
getRange(row, column, numRows, numColumns)
Example 5: google sheets get ranges
Sheet.getRange(1,1,1,12);
Example 6: .setColumnWidths() google script
let SS = SpreadsheetApp.getActiveSpreadsheet();
SS.getActiveSheet().setColumnWidths(1, 3, 180)