Hi Kevin,
I have a few questions before providing a full solution.
Where are you entering the figures to change the ranking? Are they within the table you want to sort, or are they calculated elsewhere and pulled into the table?
If the data is entered directly into the table, you will need to adjust your script. Currently, the onEdit function will only recognize the first range defined. To sort multiple ranges, you must move the range definitions inside the function like this:
function onEdit(e) {
var range1 = sheet.getRange("A8:E13");
range1.sort([{column: 5, ascending: false}]);
var range2 = sheet.getRange("[Range 2]");
range2.sort([{column: 5, ascending: false}]);
var range3 = sheet.getRange("[Range 3]");
range3.sort([{column: 5, ascending: false}]);
// Repeat for additional ranges
}
Alternatively, I recommend keeping your data entry and results dashboard separate. This allows you to maintain a clean display while hiding the raw data. If you are open to displaying the results on a different tab, you could use the QUERY function to pull and sort your data automatically without needing a script.
Please let me know if you would like to walk through this second option.
Best regards,
Laurie Nason
Laurie