Why when I run this function, "1" is appended to the variable, instead of added to it. I guess my syntax is wrong , but couldent figure out why? :\
var ss = SpreadsheetApp.getActiveSpreadsheet();
var dataSheet = ss.getSheetByName("TEST");
//get last cell with data on cloumn A
var columnA = dataSheet.getRange("A" + dataSheet.getMaxRows());
var Alast = columnA.getNextDataCell(SpreadsheetApp.Direction.UP).getA1Notation().slice(1);
//get last cell with data on cloumn C
var columnC = dataSheet.getRange("C" + dataSheet.getMaxRows());
var Clast = columnC.getNextDataCell(SpreadsheetApp.Direction.UP).getA1Notation().slice(1);
for (var counter = Clast + 1; counter <= Alast; counter = counter +1) {
Logger.log(counter);}
}
Here is the logger output:
1
11
111
Execution cancelled
Thanks