Im trying to go over 2 column and set the colour of them into red if they are not equal to specefic string, but its not working with me.
Here is my code.
function setCellColors() {
//Get the sheet you want to work with.
const thisSheet = SpreadsheetApp.openByUrl(THIS).getSheetByName('Project');
var range = thisSheet.getRange("V3:W").getValues();
var newData = range;
for (var i in newData) {
if(newData!== "There is no NCR" && newData !=="N/A" && newData!=="There is no Reason Codes"){
newData.setBackground("red");
}
}
}
I,m keep getting this error "TypeError: newData.setBackground is not a function" which I think because newData ia=s an array but how would I change it to string in that case, and is the rest of the code right?
If you need more information please let me know
Thank you.
