I've been looking on here, and youtube, and google for ages, and I still can't seem to get my script to work. here is a link to a test sheet :
Simply put, I have lots of data in non adjacent cells that needs to be changed, and want to write a script to do it (if possible, I have lots of sheets to do). So, my thinking was to do something like this :
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.getSheetByName("Sheet1").getRangeList(['A1','B2','C3','D4','E5']).setValues([10,9,8,7,6]);
}
Code obviously doesn't work, not sure why though. could anybody enlighten me?
Thanks,
EDIT : The only way I can manage to do it is cell by cell, like this :
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.getSheetByName('Sheet1').getRange('A1').setValue(10);
ss.getSheetByName('Sheet1').getRange('B2').setValue(9);
ss.getSheetByName('Sheet1').getRange('C3').setValue(8);
ss.getSheetByName('Sheet1').getRange('D4').setValue(7);
ss.getSheetByName('Sheet1').getRange('E5').setValue(6);
}

