user3376860
user3376860

Reputation: 9

Conditional formatting - Google spreadsheets

I'm using the current Google Spreadsheets. NOT the "new" version of Sheets that's in Beta at the moment. I want to do 2 things:

1 - Receive an email reminder when a certain date is reached in a cell. There is a script for this in the Scripts Gallery called "Add Reminder" but it seems to have problems (you can't set a different reminder for each tab in a spreadsheet and this is crucial functionality)

2 - Change the color of an 'entire row' automatically triggered by a cell's content. I already used the conditional formatting to try to do this, but it can only change the color of the single cell, not the entire row

I don't know how to write scripts and I know there are lots of scripts people have posted online that address these issues, but I'd looking for reliable and fast. Hoping that someone with experience can guide me to the right source for this.

Thanks! Scott

Upvotes: 0

Views: 745

Answers (1)

Bryan P
Bryan P

Reputation: 5051

you can set a different reminder for each tab by just repeating the code...

function remindMe() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];
  var data = sheet.getDataRange().getValues();
  for(var i = 1; i < data.length; i++){
    if(data[i][2] > new Date()){
      MailApp.sendEmail(message);
    }
  }

  // Now for tab index [1]
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[1];
  var data = sheet.getDataRange().getValues();
  for(var i = 1; i < data.length; i++){
    if(data[i][2] > new Date()){
      MailApp.sendEmail(message);
    }
  }
}

To set an entire row color in the old Sheets use some thing like...

sheet.getRange('1:1').setBackground('yellow');

Upvotes: 0

Related Questions