title: Can't get Google Scripts working
body: <p>I'm new to Google scripts. I found something that was supposed to work but didn't. I searched, but couldn't find a solution.</p>
  
  <p>The script I found:</p>
  
  <pre><code>function onEdit() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheetByName("My Sheet name");
    var statusValues = sheet.getRange("D:D").getValues();
    var dateValues = sheet.getRange("E:E").getValues();
    for (var row in statusValues) {
      if (statusValues[row] != "Yes" &amp;&amp; dateValues[row] == "") {
        var num = parseInt(row) + 1;
        sheet.getRange(num, 17).setValue(new Date());
      } 
    }
  };
  </code></pre>
  
  <p>It is supposed to automatically apply the editing date in column E when a cell in D says <code>Yes</code> (on the same row). When I debug it, I get:</p>
  
  <pre><code>TypeError: Cannot call method "getRange" of null. (line 5, file "Code")*
  </code></pre>
  
  <p>My D column is a drop menu with blank/Yes/No options. Could this be why? Also, it doesn't show up in my Drive. I read somewhere that was supposed to happen.</p>