Removes only formatting from a range, keeping values.
class SpreadsheetApp method .clearFormat()
SpreadsheetApp is the Apps Script service.
.clearFormat() is the method name you will see after a dot in your code.
What it does
Why it's used
- Strip conditional colors or bolding while keeping the values.
- Normalize pasted data before applying your own styles.
Common errors
- Forgetting parentheses on clearFormat. Write SpreadsheetApp.clearFormat(), not SpreadsheetApp.clearFormat or clearFormat by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').clearFormat().
- Adding spaces where they do not belong. Write SpreadsheetApp.clearFormat(), not SpreadsheetApp .clearFormat(), SpreadsheetApp.clearFormat (), or SpreadsheetApp . clearFormat().
- Wrong capitalization. Use SpreadsheetApp and clearFormat, not spreadsheetapp or clearformat.
Explore
Related methods
-
.clearContent()
Removes only cell values from a range, keeping formatting.
-
.clear()
Removes values, formatting, and notes from a range.
-
.setNumberFormat()
Sets how numbers and dates display in a range.
-
.getDisplayValues()
Reads the formatted text shown in every cell in a range.
-
.getDisplayValue()
Reads the formatted text shown in a cell, not the raw value.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about SpreadsheetApp.clearFormat().
Getting Started in Google Sheets Spreadsheet Management
Users can also customize the appearance of their spreadsheets with different fonts, colors, and themes.
Read post →What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →10 Simple Ways to Make Your Spreadsheets Better
Here's a few things you can do very simply and in no time at all, to make your spreadsheets better. Make better spreadsheets for you to spend time in. And better for other people who have to use your spreadsheets.
Read post →