title: Copy row data if status in column changes
body: <p>My function is supposed to check column 8 for one of the statuses although it doesn't seem to work.</p>
  
  <p>It checks to make sure it is a "purchase sheet", and it checks to see whether or not that purchase exists on the "dashboard", but it is only supposed to copy the row if I edit the status in "column 8" to one of the following "yes", "no", "repeat" or "sold".</p>
  
  <p>Where have I gone wrong?</p>
  
  <pre><code>function copyRow() {
      var purchasedColumn = 8; //- column A = 1, B = 2, etc...
      var targetRange = targetDashboardSheet.getRange(targetDashboardSheet.getLastRow() + 1, 1);
  
      if (purchaseSheet &amp;&amp; range.getColumn() == purchasedColumn &amp;&amp; ["Yes", "No", "Repeat", "Sold"].indexOf(range.getValue()) &gt; -1 &amp;&amp; taskDashboardRange === -1) {
          sheet.getRange(range.getRow(), 1, 1, sheet.getLastColumn()).copyTo(targetRange);
      }
  }
  </code></pre>
  
  <p>I don't believe this bit is working</p>
  
  <pre><code>range.getColumn() == purchasedColumn &amp;&amp; ["Yes", "No", "Repeat", "Sold"].indexOf(range.getValue()) &gt; -1
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>I have realized that I have a separate function interfering with the copyRow function. So my code is actually working and then being overwritten with another crossUpdate function.</p>
  
  <p>Thanks for the help, it's always appreciated.</p>