Sorry for the stupid question, but I searched the entire internet and I could not find a good tutorial to learn how to program in Google SpreadSheet Script.
I want to make a very simple function just for practice.
function simplesum(input) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets();
var range = sheet.getRange(input);
var x = 0;
for (var i = 1; i <= range.getNumRows(); i++) {
for (var j = 1; j <= range.getNumColumns(); j++) {
var cell = range.getCell(i, j);
x += (cell.getValue());
}
}
return x;
}
I know I can use = sum () to do the same. The idea here is to learn how to program.
When I try to use my function in the cell: (i.e.: = simplesum ((A1: A8)), it gives an error: "TypeError: cannot find the getRange function in the object sheet (line 4)"
What should I do?
And again, sorry for the stupid question ....