Script - CopyTo not copying dates

178 views
Skip to first unread message

Laura Pedro

unread,
Mar 2, 2020, 3:23:54 PM3/2/20
to Google Apps Script Community
I've been working with the code below for more than a year now. Recently I started having issues when trying to copy dates. I have to run it several times before it paste the columns containing dates.

Has anyone had an issue like this? Is there a workaround?

function copyPLT() {
  {      
      var sss = SpreadsheetApp.openById('Sheet1 Id'); //replace with source ID
      var ss = sss.getSheetByName('ZNF Product Lot Tracking'); //replace with source Sheet tab name
      var range = ss.getRange('A2:O1002'); //assign the range you want to copy
      var data = range.getValues();
      var tss = SpreadsheetApp.openById('Sheet2 Id''); //replace with destination ID
      var ts = tss.getSheetByName('Product Lot Tracking All'); //replace with destination Sheet tab name
      var TRange= ts.getRange('A3616:O4616').getValues()
      ts.getRange('A3616:O4616').setValues(data); //you will need to define the size of the copied data see
 }

Jean-Luc Vanhulst

unread,
Mar 2, 2020, 3:27:46 PM3/2/20
to google-apps-sc...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/9f6c2359-651b-4b79-992b-66e5fd693a5b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages