Beginner trying to use scripts, please help!
I am needing a way to automatically sort multiple columns on different sheets in the same workbook. The current script I am using is only sorting one sheet.
const SHEET_NAME = "History";
const SORT_DATA_RANGE = "A2:Y";
const SORT_ORDER = [
{column: 25, ascending: true},
{column: 17, ascending: true},
{column: 1, ascending: true}
];
function HistorySort(e){
multiSortColumns();
}
function multiSortColumns(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(SHEET_NAME);
var range = sheet.getRange(SORT_DATA_RANGE + sheet.getLastRow()); // change here
range.sort(SORT_ORDER);
ss.toast('Sort complete.');
}