Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. function copypaste() {
  2. var ss = SpreadsheetApp.getActiveSpreadsheet();
  3. var sheet1 = ss.getSheetByName("FMGXfers");
  4. var sheet2 = ss.getSheetByName("FMGInventory");
  5. var numRows = sheet1.getRange('R1').getDisplayValue();
  6.  
  7. var index = 3
  8. var sourceCell = 'T'+index;
  9. var sourceRef = 'U'+index;
  10. var targetCell = sheet1.getRange(sourceRef).getDisplayValue();
  11. var sourceValue = sheet1.getRange(sourceCell).getValues();
  12.  
  13. for (var i=1; i<numRows; i++) {
  14. sheet2.getRange(targetCell).setValues(sourceValue);
  15. var index = index++;
  16. var sourceCell = 'T'+index;
  17. var sourceRef = 'U'+index;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement