How to Copy a Sheet to a Different Spreadsheet in Google Sheets✅
how to copy one google sheet data to other google sheet as value using google script
We explain this using some steps follow this way
go to this sheet and open app script
then will show like this windows
and copy and paste here this below code
function copypaste(sourcelink,sourcesheet,sourcerange,destilink,destisheet,destirange) {
//Source link
var ssraw = SpreadsheetApp.openByUrl(sourcelink);
var sheetraw = ssraw.getSheetByName(sourcesheet);
var range = sheetraw.getRange(sourcerange);
var data = range.getValues();
//Destination
var ss = SpreadsheetApp.openByUrl(destilink);
var sheet = ss.getSheetByName(destisheet);
// transfer to destination range
sheet.getRange(destirange).clearContent();
sheet.getRange(destirange).setValues(data);
}
function run(){
copypaste("https://docs.google.com/spreadsheets/d/1akDQoaFxziLU42iern_1lExokveIGZC50knkna9T3iA/edit#gid=1287266599","raw","A1:F600",
"https://docs.google.com/spreadsheets/d/1tpqQVFlYOf1fqbtDSyYZHh4H5PX1AOcgm_Kka5Pi5qU/edit#gid=2088523282","test","A1:F600")
}
then you can see like this
01 this area paste your data contain excel URL
2 is that sheet tab name
3 is data range
example like this after go second URL
like this
1 is Google sheet URL
2 is that google sheet tab name
3 what area you going paste
you can apply same theory
after complete that then select Run command and press run button then will success
if not success message us we are help you
then we can set this run in schedule or specific time as loop
go to Tigger and add Tigger
after save then it will run as loop
then your data always paste and replace
if your aim and your task is deference then tell us we will help you
if not clear watch our video for more clarification
thank you
0 Comments