title: Run trigger script when a one or more cells change in a range
body: <p>I'm new to google sheets &amp; script app.  I'm using google sheets to maintain real-time project budgets.  I've created a history tab to capture historical high level information (project code, category, Total Approved Budget, Projected Cost, Date stamp).  Each time the scrip runs, it captures 4 rows of data.</p>
  <pre><code>function recordHistory() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet1 = ss.getSheetByName('ForMaster');
    var sheet2 = ss.getSheetByName('History');
    var data = sheet1.getRange('S84:W87').getValues();
    var last_row = sheet2.getLastRow();
  
    sheet2.getRange(last_row + 1,1,4,5 ).setValues(data);
  }
  </code></pre>
  <p>I'd like to set up a trigger that runs where ever there is a change to any of the cells in data range (S84:W87).</p>
  <p>I've tried the following, but it doesn't seem to work.</p>
  <pre><code>function setupTrigger() {
    ScriptApp.newTrigger('recordHistory')
    .forSpreadsheet('1TSX27lzmOpv6P8Z8zJJhYem_yLQwP-gYK4WYHJ3LEuA')
    .onEdit()
    .create();
  }
  
  function recordHistory(e) {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet1 = ss.getSheetByName('ForMaster');
    var sheet2 = ss.getSheetByName('History');
    var data = sheet1.getRange('S84:W87').getValues();
    var last_row = sheet2.getLastRow();
    
    sheet2.getRange(last_row + 1,1,4,5 ).setValues(data);
  }
  </code></pre>