title: Google script - Not equal to not working correctly?
body: <p>I'm currently working on a script that will import the holiday and appointments calender to make it public, however there are some things on this holiday calendar that need removing so after the sheets are imported i'm scanning the values of each cell to remove the cells that contain stuff others shouldnt be able to see</p>
  
  <pre><code>var code = ss.getSheetByName(mysheet).getRange(k,j).getValue();
  if (code != "HD" || code != "H" || code != "BH" || code !== "") {
    ss.getSheetByName(mysheet).getRange(k,j).setValue("");
  }
  </code></pre>
  
  <p>This is the code that is used for getting the value of the cell and checking it, it looks for cells that are not blank or do not contain any off the allowed codes however for some reason it keeps picking up every blank cell, why is this?</p>
  
  <p>Also is there any over way to make this code run more faster and effectively?</p>
  
  <pre><code>function scanSheet(mysheet,lastdatecol){
    var lastrw= ss.getSheetByName(mysheet).getDataRange().getLastRow();
    for (var k=3; k&lt;=lastrw; k++){
      var surname = holidayNamesObjects[k-3].surname;
      var forename = holidayNamesObjects[k-3].firstName;
      ss.getSheetByName(mysheet).getRange(k, 1).setValue(forename + " " + surname)
      for (var j = 3; j &lt; lastdatecol+1; j++){
        var code = ss.getSheetByName(mysheet).getRange(k,j).getValue();
        if (code != "HD" || code != "H" || code != "BH" || code !== "") {
          ss.getSheetByName(mysheet).getRange(k,j).setValue("");
        }
      }
    }
  }
  </code></pre>