Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
Cómo pasar algunos datos de una hoja de cálculo a otra

Estoy tratando de llevar las primeras 7 columnas de una hoja de cálculo a otra hoja de cálculo usando el script de la aplicación de Google, pero honestamente busqué mucho y no encontré la manera de hacerlo.

 function MoveCode(){ var ss1 = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1zU__ccPIMst54whmyrbmRnDRRjOtQBFPzXhw6NsFqpU/edit#gid=432949714");//369 var sheet1 = ss1.getSheetByName("Sourcing"); var wpLink1 = sheet1.getRange("A2:G").getValues(); var ssData1 = SpreadsheetApp.openByUrl("This-Spread-sheet"); var sheetPrime1 = ssData1.getSheetByName("Sheet1"); var data = sheet1.getRange("A2:G").getValues(); sheetPrime1. }

Quiero mover el código de manera que, si actualizo el primero, se actualice en el segundo.

Si necesita más explicación por favor hágamelo saber. Gracias.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Mover las primeras siete columnas

 function MoveCode(){ const ss1 = SpreadsheetApp.getActive(); const ss2 = SpreadsheetApp.openById("id");//or url whatever const ssh = ss1.getSheetByName('Sourcing'); const dsh = ss2.getSheetByName('Sheet1'); const vs = ssh.getRange(2,1,ssh.getLastRow() - 1,7).getValues(); dsh.getRange(2,1,vs.length,vs[0].length).setValues(vs); }
about 4 years ago · Juan Pablo Isaza Report

0

Ampliando el ejemplo de Cooper. Creo que lo que quiere es que cada vez que cambie un valor en la hoja 1, se actualizará automáticamente en la hoja 2. Puede usar un onEdit limitado a las primeras 7 columnas de la hoja 1 para copiar el valor a la hoja 2. O aquí hay un script que crea un foro en cada celda de la hoja 2 a la celda de la hoja 1. Pero realmente solo necesita ejecutar esto una vez a menos que cambie el tamaño de cualquiera de las hojas de cálculo.

 function moveCode() { try { const ss1 = SpreadsheetApp.getActive(); //const ss2 = SpreadsheetApp.openById("id");//or url whatever const ssh = ss1.getSheetByName('Sheet1'); // source const dsh = ss2.getSheetByName('Sheet2'); // destination var srange = ssh.getDataRange(); var formulas = []; var i=0; var j= 0; var row = null; // srange.getNumRows()-1 because skip the first row for( i=0; i<srange.getNumRows()-1; i++ ) { row = []; for( j=1; j<8; j++ ) { row.push("=Sheet1!"+String.fromCharCode(64+j)+(i+2).toString()); // A = 65 } formulas.push(row); } dsh.getRange(2,1,formulas.length,formulas[0].length).setValues(formulas); } catch(err) { Logger.log(err); } }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!