jeudi 1 septembre 2016

Google Sheets Script - If or statement

Super quick question. I have this function I want to run on entire workbook, except two specific sheets.

This is my code:

function onEdit(e) {
  var sheet = SpreadsheetApp.getActiveSheet();
  if (sheet.getName() != "Total" || sheet.getName() != "DataRange" ) { 
    someAction();
  }
}

This just does not work, the code runs on all sheets no matter what. This is probably a noob question but.

Aucun commentaire:

Enregistrer un commentaire