My team uses a spreadsheet to track all events that are being hosted and worked on at any given time. This sheet has been set up to auto sort from the day it was started. Once you put in the event hosts unique id then the sheet will sort all other data and put it in order by the event date. We have been using this script for the last two years with no problems but as of yesterday I am now getting an error message and the code isn't working. Here is the current script that is written:
SHEET_NAME = "ESS Event Support";
SORT_DATA_RANGE = "A3:X";
SORT_ORDER = [
{column: 10, ascending: true},
];
function onEdit(e){
var sheet = SpreadsheetApp.getActiveSheet();
var editedCell = sheet.getActiveCell();
if (editedCell.getColumn() == 16) {
multiSortColumns();
}
}
function multiSortColumns(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(SHEET_NAME);
var range = sheet.getRange(SORT_DATA_RANGE);
range.sort(SORT_ORDER);
ss.toast('Sort complete.');
}
The spreadsheet should auto sort once all information is entered and the hosts name has been added in column P but now the sheet is not sorting at all and an error message is showing up that says: Error: Invalid argument multiSortColumns @ Auto-sort by date.gs:19 onEdit @ Auto-sort by date.gs:12