Hi guys, thank all of you for your help.
Bo (Clay) Thank you for the explanation. I did what you suggested. So I am transfering the data to the new sheet and I implemented the Google script. But for some reason the data do not transfer between the sheets.
Here is the code I used:
function copyNewRowsToDifferentFile() {
var sourceSpreadsheet = SpreadsheetApp.openById(“1hjGSXleUWUmbps_GTIVHFLjRbUSGuw0BKZEzt5Dbn2w”);
var destinationSpreadsheet = SpreadsheetApp.openById(“1F7rMxEB2TK7cbpzGHxhm0mcCamxhR_I410LUKAZN1v4");
var sheetA = sourceSpreadsheet.getSheetByName(“Companies”);
var sheetB = destinationSpreadsheet.getSheetByName(“Companies”);
var dataA = sheetA.getDataRange().getValues();
var lastRowB = sheetB.getLastRow();
if (dataA.length > lastRowB) {
var newRows = dataA.slice(lastRowB);
sheetB.insertRowsAfter(lastRowB, newRows.length);
sheetB.getRange(lastRowB + 1, 1, newRows.length, newRows[0].length).setValues(newRows);
}
}