I have the following code that I'm trying to link to a button to sort a range on the page by the column H (Date). I got the button linked but the code is not working
function sortRange() {
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('FBY Team');
var sheet = ss.getSheets()[0];
var range = sheet.getRange("A6:M100");
range.sort({column: 2, ascending: true});
}
I have added a link to my test spreadsheet. https://docs.google.com/spreadsheets/d/1iWQ40boplJcJmdFg9HNIyOAOrHOjlCRu362LWRdV5y0/edit?usp=sharing