I am trying to format a cell to have multiple font colors using a function in Google Apps Script. I am unable to find any documentation on it. Also, using getFontColor()
doesn't return anything useful.
Is there any way to programmatically reproduce this functionality
that is available to users via the Google Sheets web UI?
Best Answer
As on July 2018, Apps-Script support changing individual text colors and other font related styles. Two methods are added to
SpreadsheetApp
.newTextStyle()
andnewRichTextValue()
. The following apps-script changes such fontstyles in A1. For best effects, Use a lengthy string(30 characters or more).Documentation is not published yet. Methods are subject to changeReferences: