I'm working on a script that will copy a certain range of Sheet A and paste it in Sheet B after the last record, I know it should be pretty easy, but somehow the code is not working, could you please advise me on what am I doing wrong here, it will clear the contents of the cell, but copy partially the data from Sheet A to Sheet B
function Export2() {
var ss = SpreadsheetApp.getActiveSpreadsheet()
var database = SpreadsheetApp.openById("XXX");
var source = ss.getSheetByName('Sheet1');
var dataToCopy = source.getRange('B2:G10');
var copyToSheet = database.getSheetByName("Sheet2");
var lastRow = copyToSheet.getLastRow();
for (var i = 1; i<6 ;i++){
var Paste = copyToSheet.getRange(lastRow + 1,i).setValues(dataToCopy.getCell(1,i).getValues());
}
var Clean = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1').getRange('B2:G10');
Clean.clear({contentsOnly:true});
}