Skip to content

Instantly share code, notes, and snippets.

@rafamerino
Created December 4, 2024 06:34
Show Gist options
  • Save rafamerino/55f5528af077597bcd78c768445ff3bb to your computer and use it in GitHub Desktop.
Save rafamerino/55f5528af077597bcd78c768445ff3bb to your computer and use it in GitHub Desktop.
Clear users custom format in Google Sheets
// For a SPECIFIC COLUMN
function onEdit(){
if(e.range.columnStart === 8){ // CHANGE THE COLUMN
var spreadsheet = SpreadsheetApp.getActive();
var activeRange=spreadsheet.getActiveRange();
activeRange.clearFormat();
}
}
// =======================================================
// For a FULL RANGE
function onEdit(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var range = sheet.getRange("A1:D10"); // CHANGE THIS RANGE
range.clearFormat();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment