I would like to color in red the rows where between column F and K there is no value ' ', or the value KO.
I managed to find a script where I can delete the lines where these conditions are met, but not to color them:
function deleteRows()
{
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
let numRows = rows.getNumRows();
var values = rows.getValues();
var rowsDeleted = 0;
for (var i = 0; i <= numRows - 1; i++)
{
var row = values[i];
if (row[5] == 'KO' || row[5] == '')
if (row[6] == 'KO' || row[6] == '')
if (row[7] == 'KO' || row[7] == '')
if (row[8] == 'KO' || row[8] == '')
if (row[9] == 'KO' || row[9] == '')
if (row[10] == 'KO' || row[10] == '')
{
sheet.deleteRow((parseInt(i)+1) - rowsDeleted);
rowsDeleted++;
}
}
}
could you help me on this? thanks in advance.
I believe your goal is as follows.
In this case, how about the following sample script?
Sample script:
setBackgrounds(color)is used.References: