title: Google Scripts - Copy rows to a new sheet when column H has a specific colour (Yellow)
body: <p>I've played around with this script but have still yet to get it to work.</p>
  
  <p>I need a script that looks at the column F's background color in the sheet called <strong>Test</strong>.</p>
  
  <p>If the cell background in Column F is yellow it will copy that entire row to a new sheet called <strong>New Data</strong>.</p>
  
  <p>Please find attached the Google Spreadsheet link: <a href="https://docs.google.com/spreadsheets/d/19pMAmB94tOoV14MiSPyoPhty2dO5OudO4NupP8KhJA4/edit#gid=1703438513" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/19pMAmB94tOoV14MiSPyoPhty2dO5OudO4NupP8KhJA4/edit#gid=1703438513</a></p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <pre><code>function Extract(){ 
    var ss = SpreadsheetApp.getActive();
    var sheet = ss.getSheetByName('Test');
    var rows = sheet.getDataRange();
    var numRows = rows.getNumRows();
    var values = rows.getBackgrounds();
    var yellowColour = '#ffff00';
    var whiteColour = '#ffffff';
  
  
    var newSheet = ss.getSheetByName('New Sheet');
  
   for (var i = 0; i &lt;= numRows - 1; i++) {
  
   var row = values[i];
  
     if (row[6] === whiteColour ) {  
  
     } 
       else {
  
         newSheet.appendRow(row);
  
       }
  
   } // End of For Loop
  };
  </code></pre>