Sets the text color of cells in a range.
class SpreadsheetApp method .setFontColor()
SpreadsheetApp is the Apps Script service.
.setFontColor() is the method name you will see after a dot in your code.
What it does
Why it's used
- Flag expired dates or negative balances in red.
- Match brand colors on auto-generated reports.
Common errors
- Forgetting parentheses on setFontColor. Write SpreadsheetApp.setFontColor(), not SpreadsheetApp.setFontColor or setFontColor by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').setFontColor().
- Adding spaces where they do not belong. Write SpreadsheetApp.setFontColor(), not SpreadsheetApp .setFontColor(), SpreadsheetApp.setFontColor (), or SpreadsheetApp . setFontColor().
- Wrong capitalization. Use SpreadsheetApp and setFontColor, not spreadsheetapp or setfontcolor.
Explore
Related methods
-
.setBackground()
Sets the background color of cells in a range.
-
.setFontWeight()
Sets text to normal or bold in a range.
-
.setWrap()
Turns text wrapping on or off for cells in a range.
-
.setNumberFormat()
Sets how numbers and dates display in a range.
-
.setHorizontalAlignment()
Sets left, center, or right alignment for cells in a range.
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.setFontColor().
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
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 →Getting Started in Google Sheets Spreadsheet Management
Users can also customize the appearance of their spreadsheets with different fonts, colors, and themes.
Read post →