Been looking around for a solution to this for a while and not finding anything that works, unfortunately. I have tried copying and pasting several bits of code but cannot get my sales pipeline sheet to automatically sort on edit of a date field.
The link below is to a test sheet which should give an idea as to how I have formatted my sheet:
I want to sort by Column G with the most recent dates at the bottom of the sheet.
Any suggestions welcome!
Thank you in advance for your help.
this should help?
function onEdit(e) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Sheet1")
var range = sheet.getRange("A2:Z450");
// Sorts by the values in column 2 (B)
range.sort({column: 2, ascending: false});
}