I'm trying to get the first empty row of a column. The number of this column is determined by a variable.
var values = pnl.getRange('A:A').getValues(); //Returns 2D array
var firstEmptyRow = 4;
while(values[firstEmptyRow]&&values[firstEmptyRow][0]!=""){
firstEmptyRow++;
}
firstEmptyRow++;
pnl.getRange(firstEmptyRow,1+24*month).setValue(firstEmptyRow);
This works fine, however in this function the range of the column is always the same.
Here is what I'm trying to do
var lastRow = pnl.getLastRow()
var columnRange = pnl.getRange(4,1+24*month,lastRow,1);
var values = columnRange.getValues(); //Returns 2D array?
var firstEmptyRow = 4;
while(values[firstEmptyRow]&&values[firstEmptyRow][0]!=""){
firstEmptyRow++;
}
firstEmptyRow++;
pnl.getRange(firstEmptyRow,1+24*month).setValue(firstEmptyRow);
I don't get any errors, the code simply doesn't work.