I have a script in google sheets that allows me to have my sheet sorted as soon as one date column changes. Here is the script.
function onEdit(event){
var sheet = event.source.getActiveSheet();
var editedCell = sheet.getActiveCell();var columnToSortBy = 9;
var tableRange = “a3:ac103”;if(editedCell.getColumn() == columnToSortBy){
var range = sheet.getRange(tableRange);
range.sort( { column : columnToSortBy } );
}
}
I see previous forums here about this such as this one closed in '15 and I’ve seen others that suggest Pivot Tables. Neither of these are worthwhile for me. I just want my sheet to autosort simply upon a change in date. I find this function so beneficial that I cannot change from google sheets until someone else offers this.
Is there a way to do this here?