Trying to do conditional formatting [in a google spreadsheet] on a row based on either a text cell in column a, or ideally, a combination of a and b. ["Hot lead" + "large opp"]
My header rows are at the top, so key data starts at a3.
Trying to do conditional formatting [in a google spreadsheet] on a row based on either a text cell in column a, or ideally, a combination of a and b. ["Hot lead" + "large opp"]
My header rows are at the top, so key data starts at a3.
function onEdit() { var s = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1'), values = s.getRange('A3:B').getValues(), x, rowColors = [], color, colors = [], numCols = 3;
for (var row = 0, len = values.length; row < len; row++) { if (values[row][0] === 'Hot lead' && values[row][1] === 'large opp') color = 'Red'; else color = 'White'; for (x = 0; x < numCols; x++ ) rowColors.push(color); colors.push(rowColors); rowColors = []; }
s.getRange('A3').offset(0,0,colors.length, numCols).setBackgroundColors(colors); }