title: I have a function OnEdit Script running that used to auto sort on edit and its no longer working
body: <p>I have a function OnEdit Script running that used to auto sort on edit column 3 that is no longer working when edited; I have to go in and run it manually to get it to sort.  It works in another google sheets file I have.  Can someone please help?</p>
  
  <p>My script and file links are below:</p>
  
  <p><a href="https://docs.google.com/spreadsheets/d/1DcLsFpVn90hCg0biVa_zyjKz2GdEmlqui0a3oF0ZQW8/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1DcLsFpVn90hCg0biVa_zyjKz2GdEmlqui0a3oF0ZQW8/edit?usp=sharing</a></p>
  
  <pre><code>function OnEdit() {
    var sheetNames = ["ALPHA"];
  
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    sheetNames.forEach(function(name) {
      var sheet = ss.getSheetByName(name);
      var range = sheet.getRange(2, 1, sheet.getLastRow() - 1, sheet.getLastColumn());
      range.sort([{column: 3, ascending: true}])
    });
  }
  </code></pre>