-1

This question already has an answer here:

Currently this code is only applied to the sheet called "Name" I wanted applied to all except for 3 sheets (Template,Summary and Count):

 function EqualValue() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName("Name");
  var value = sheet.getRange("A5").getValue();
  if(value >= "15") sendEmail(value)

};


function sendEmail(value){
  var recipient="Tester@test.com";
  var subject=" test subject " +value;
  var body="The Value is "+value;
  MailApp.sendEmail(recipient, subject, body);
};

I am not sure how is best to do this.

marked as duplicate by Rubén, serenesat, ale, jonsca Dec 20 '18 at 23:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @Rubén Unfortunately I tried that and it did not work – RealHelper Dec 17 '18 at 12:52
  • Please update the question to show what you tried and a brief description of what you know about Javascript conditions. – Rubén Dec 17 '18 at 15:02
0
    function EqualValue() {
  var allSheetTabs,i,L,thisSheet,thisSheetName,sheetsToExclude,value;

  sheetsToExclude = ['Template','Summary','Count'];

  var ss = SpreadsheetApp.getActiveSpreadsheet();

  allSheetTabs = ss.getSheets();

  L = allSheetTabs.length;

  for (i=0;i<L;i++) {
    thisSheet = allSheetTabs[i];
    thisSheetName = thisSheet.getName();

    //continue to loop if this sheet is one to exclude
    if (sheetsToExclude.indexOf(thisSheetName) !== -1) {continue;}

    value = thisSheet.getRange("A5").getValue();
    if(value >= "15") sendEmail(value)
  }

And soo on

Not the answer you're looking for? Browse other questions tagged or ask your own question.