title: Clear matching cells on different tables (Unordered columns)
body: <p>so... i got a problem on comparing different tables contents. </p>
  
  <p>I basically need to clear the content where the cells data is the same, but the tables are unordered, and when i run my code, only the first line is cleared.</p>
  
  <p>So i modified from this (Because it was clearing only the first line of the table): </p>
  
  <pre><code>function clearSourceValues(){
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sourceTable = ss.getSheetByName("Encaminhamento");  
    var targetTable = ss.getSheetByName("testeBD");
  
  
    var rowCount = targetTable.getLastRow() + 1;
  
  
    var sourceValues = sourceTable.getRange(2, 8, rowCount, 1).getValues();
    var targetValues = targetTable.getRange(2, 3, rowCount, 1).getValues();
  
  
  
    for (var i = 0; i &lt; targetValues.length; i++){ // Modified
      var clearRange = targetTable.getRange(i + 2, 2, 1, 8); // Modified
      if (targetValues[i][0] == sourceValues[i][0]){
        clearRange.clear();
      };
    };;
  };
  </code></pre>
  
  <p>To this:</p>
  
  <pre><code>  for (var i = 0; i &lt; targetValues.length; i++){ 
      var clearRange = targetTable.getRange(i + 2, 2, 1, 8); 
      for (var j = 0; j &lt; sourceValues.length; j++){ 
        if (targetValues[i][0] == sourceValues[j][0]){
          clearRange.clear();
        };
      };
    };
  </code></pre>
  
  <p>But now when i run it, every cells are cleared.</p>