The following script I have with the purpose of automatically sorting things does not work, and returns with "Exception: Cell reference out of range onEdit Code.gs.6 (which directs you to range.sort, placing you after the .)
Does anyone know a fix to this?
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("STANDINGS");
var range = sheet.getRange("S5:Y8");
function onEdit(e) {
range.sort([{column: 5, ascending: true}]);
}