0

I hope this will explain what I need: https://docs.google.com/spreadsheets/d/1--4UL1SjdEv-YT-_gTpvKqy9H4SDEdBm8aubFpUZYuw/edit?ts=5be08e3d#gid=0

So here I have B, C, L, M and S information.

I would like to run the script and then row 4-7 gets copied to Notepad tab, and then it sets the value Copied on column T. (as per 2 and 3 row).

Then in a case when Copied is written, the script should skip those and copy only the remaining ones.

Please let me know if still not clear.

Thank you!

function copyInfo() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var copySheet = ss.getSheetByName("Test");
  var pasteSheet = ss.getSheetByName("Sheet5");

  var columns_to_be_copied = ['B', 'L', 'M', 'V'];
  for (column in columns_to_be_copied){
  var copy_range_string = columns_to_be_copied[column] + ':' + columns_to_be_copied[column];

  // get source range
  var source = copySheet.getRange(copy_range_string);
  // get destination range
  var destination = pasteSheet.getRange(pasteSheet.getLastRow()+1,1,8,4);

  // copy values to destination range
  copyTo(source,destination );
  }
}
David
  • 5
  • 3
  • It seems that your script is not included in your shared spreadsheet. Can you include your latest one and also show it in your question? I think that showing your script will help users think of your solution. – Tanaike Nov 07 '18 at 22:21
  • Have you checked this related [so post](https://stackoverflow.com/a/44967382/5995040)? – Mr.Rebot Nov 09 '18 at 11:44
  • Thank you @Mr.Rebot ! But how do I add set value to cells T for all of those copied ones? Thank you very much! – David Nov 09 '18 at 16:30
  • I have the new code but it keeps putting pasted values below each other. What am I doing wrong? – David Nov 09 '18 at 21:45

0 Answers0