I'm using the following code to copy-paste from a Gsheets file into other Gsheets file, but I would like to do it maintaining the original source format.
Anyone can help with this issue?
The problem today is that I have some numbers stored as text and after I copy-paste if, these fields automatically change their format into numbers.
Thank you so much in advance.
function Run_function1() {
var ss = SpreadsheetApp.openById("Destination ID");
const sk = ss.getSheetByName('Settings WS');
var cc = sk.getRange("cell with origin file ID").getValue();
const sh = ss.getSheetByName('Destination WS');
sh.getRange(2,1,sh.getLastRow(),30).clearContent();
var dbss=SpreadsheetApp.openById(cc);
const dbsh=dbss.getSheetByName('Origin WS');
var vs=dbsh.getRange(2,1,dbsh.getLastRow()-1,25).getValues();
Logger.log(dbsh);
var ff=sh.getRange(2,1,dbsh.getLastRow()-1,25).setValues(vs);
}