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
}