Answer the question
In order to leave comments, you need to log in
How to recolor text in selected cells?
Hello.
There is a google spreadsheet. It contains several cells. How to recolor the text in these selected cells?
This is how we recolor when the cells are known.
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRangeList(['A4', 'A8', 'A13', 'A19', 'A23']).activate()
.setFontColor('#ff0000');
Answer the question
In order to leave comments, you need to log in
Here is a code that will help:
function rePaint() {
SpreadsheetApp.getActive().getActiveRangeList().setBackground('#ff9900');
};
Wrote a function. But it doesn't color the text. Where is the mistake?
function ColorRange(){
const sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Прейскурант товаров");
//sheet1.getActiveRange().setFontColor('#00ff00');
sheet1.getActive().getActiveRangeList().setFontColor('#00ff00');
};
function ColorRange(){
const sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Прейскурант товаров");
sheet1.getActiveRangeList().setFontColor('#00ff00');
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question