var cur_ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var data = cur_ss.getDataRange().getValues(); var Avals = cur_ss.getRange("B9:B").getValues(); var Alast = Avals.filter(String).length; return (Alast + 9);