removes unused styles for the current sheet
$$("ss1").compactStyles();
Note that this method doesn't clear the unused number formats, as the method clears the current sheet, while number formats are common for all the sheets.
To clear the unused number formats, use the following code:
const serialized = spreadsheet.serialize({sheets:true, compactStyles:true});
spreadsheet.parse(serialized);
Back to top