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

247
Views
¿Por qué recibo TypeError: no se puede leer la propiedad '0' del error indefinido en el script de Google Apps?

Solo estoy tratando de poner en negrita los datos de la primera columna en la hoja.

 function formatColumnHeader(){ var thisSheet = SpreadsheetApp.getActiveSheet(); var dataRange = thisSheet.getDataRange(); var dataValues = dataRange.getValues(); for(var row =1;row<dataValues.length;row++){ dataRange[row][0].setFontWeight('bold'); } }

Pero obtengo TypeError: No se puede leer la propiedad '0' de un error indefinido. ¿Qué estoy haciendo mal aquí?

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

0

Puedes probar range.offset :

 function formatColumnHeader(){ const thisSheet = SpreadsheetApp.getActiveSheet(), dataRange = thisSheet.getDataRange(); dataRange.offset(0, 0, dataRange.getNumRows(), 1).setFontWeight('bold'); }

O si no necesita dataRange , pruebe getRange() para obtener solo el rango que necesita:

 function formatColumnHeader(){ const thisSheet = SpreadsheetApp.getActiveSheet(); dataRange = thisSheet.getRange(1, 1, thisSheet.getLastRow()).setFontWeight('bold'); }
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!