function clear() { var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1'); var rangesToClear = ['A2:J300']; for (var i=0; i<rangesToClear.length; i++) { sheet.getRange(rangesToClear[i]).clearContent(); } }