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

198
Views
Copias de Hojas Ocultas en Apps Script

Tengo este fragmento de código que hace una copia de cada Hoja en el documento. No se si hace copias de Hojas Ocultas, la copia _temp de las hojas ocultas no aparece en la interfaz pero supongo que también están ocultas. En caso de que haga las copias, ¿cómo podría modificar el código para que no copie hojas ocultas? Tengo muchas cosas ocultas en mi documento y podría ahorrar tiempo y evitar bloqueos.

 var ss = SpreadsheetApp.openById(spreadsheetId); var tempSheets = ss.getSheets().map(function(sheet) { var dstSheet = sheet.copyTo(ss).setName(sheet.getSheetName() + "_temp"); var src = dstSheet.getDataRange(); src.copyTo(src, {contentsOnly: true}); return dstSheet; });

Gracias

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

0

Esto debería funcionar:

 var ss = SpreadsheetApp.openById(spreadsheetId); var tempSheets = ss.getSheets().filter(sheet => !.isSheetHidden()).map(function(sheet) { var dstSheet = sheet.copyTo(ss).setName(sheet.getSheetName() + "_temp"); var src = dstSheet.getDataRange(); src.copyTo(src, {contentsOnly: true}); return dstSheet; });

sheet.isSheetHidden() devolverá true si la hoja está oculta y false en caso contrario. Primero filtramos la lista a hojas no ocultas y luego solo copiamos el resto de las hojas.

about 4 years ago · Juan Pablo Isaza Report

0

Copiar hojas no ocultas

 function copyunhidden() { const ss = SpreadsheetApp.openById("id"); ss.getSheets().filter(sh => !sh.isSheetHidden()).forEach(s => { s.copyTo(ss).setName(s.getName() + "_temp") }); }
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!