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

82
Views
Copie celdas que no estén en blanco en la columna y fila exactas

Necesito copiar datos de un rango seleccionado (Y5:Z198) a la celda (Y206) pero de alguna manera solo puedo hacerlo en appendRow y pegar solo en la columna A. ¿Alguien puede ayudarme, por favor?

 function CopyData(CopyData) { var ss = SpreadsheetApp.getActive(); var sh1 = ss.getSheetByName("CAPA"); var sh2 = ss.getSheetByName("CAPA"); var rg1 = sh1.getRange("Y5:Z198"); var vA = rg1.getValues(); for (var i = 0; i < vA.length; i++) { if (vA[i][1]) { sh2.appendRow(vA[i]); } } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba este código para copiar los datos.

 function CopyData(CopyData) { const dstRow = 206; let ss = SpreadsheetApp.getActive(), sheet = ss.getSheetByName('CAPA'), srcRange = sheet.getRange('Y5:Z198'), srcValues = srcRange.getValues(), filtered = srcValues.filter(item => item[1]); // filter the data being copied // Define the range to insert // 'Y'+dstRow -> Y206 // filtered.length -> the number of rows in the filtered array of data // ':Z'+(dstRow-1+filtered.length) -> bottom right cell sheet.getRange('Y'+dstRow+':Z'+(dstRow-1+filtered.length)).setValues(filtered); }
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!