I am trying to sort in descending order the cells with a 'rose' background, as you can do in the 'filter' or 'custom sort' but with ExcelScript for web:
range.getSort().apply([ {
ascending: false,
key: 5,
sortOn: ExcelScript.SortOn.cellColor,
subField: "Rose"
}]);
But it does not work. I have tried to record a macro with either sorting cell color or font but the macro does not record the SortOn, instead it just shows:
selectedSheet.getRange("A8:K50").getSort().apply([{key: 0, ascending: true}], false, true);
Is there any way to sortOn cell color with ExcelScripts?