title: Limit paste range to 3 columns in script
body: <p>I had created a script to copy information to a second tab when a column's value is &quot;Yes&quot; (column 11 in the spreadsheet). However, I only want it to copy the row data for the first 3 columns (vs ALL the data from the row).</p>
  <p>The solution I had worked fine in my initial test but when I went to use it in another spreadsheet it is now copying 10 columns worth of data when column 11 = &quot;Yes&quot; vs just the first 3 - Any ideas why this might be? Thank you in advance!!</p>
  <pre><code>    var destinationSheet = &quot;Destination Sheet&quot;
      var check = {
        &quot;col&quot;:11,
        &quot;changeVal&quot;: &quot;Yes&quot;,
        &quot;del&quot;: false ,
        };
      var pasteRange = {
        &quot;start&quot;: 1, 
        &quot;cols&quot;: 3
        };
      function onEdit(e) {
        var sheets = ['Source Sheet'];
        var sheet =  e.range.getSheet();
        var sheetName = sheet.getSheetName();
        if(sheets.indexOf(sheetName) != -1){
          var cell = e.range;
          var cellCol = cell.getColumn();
          var cellRow = cell.getRow(); 
          if(cellCol === check.col){
            if(cell.getValue() === check.changeVal){
              var exportRange = sheet.getRange(cellRow,pasteRange.start,1,pasteRange.cols);
              var pasteDestination = e.source.getSheetByName(destinationSheet);
              var pasteEmptyBottomRow = pasteDestination.getLastRow() + 1;
              exportRange.copyTo(pasteDestination.getRange(pasteEmptyBottomRow,1),
                         SpreadsheetApp.CopyPasteType.PASTE_VALUES);
              if(check.del){
                var sheet = e.range.getSheet();
                sheet.deleteRow(cellRow);
      };
     };
    };
   };
  };
  </code></pre>