Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
How to delete all rows from certain row to the LastRow?

I do not need to clear blank cells or anything. Just need to delete data from Row 800 to the Last Row.

My current code is as below, but it keeps return Range Not Found. How do I do it?

  function DeleteOld() {
    var spreadsheet = SpreadsheetApp.getActive();
    var lastRow = spreadsheet.getLastRow();
    spreadsheet.getRange('800:lastRow').activate();
    spreadsheet.getActiveSheet().deleteRows(spreadsheet.getActiveRange().getRow(), 
    spreadsheet.getActiveRange().getNumRows());
  Logger.log('Data Before 1990 deleted') 
  };

I tested the getLastRow function to see its number.

var spreadsheet = SpreadsheetApp.getActive();
Logger.log(spreadsheet.getLastRow())   };

The return is "12344.0" If I changed the code to getRange('800:12344"), it works well. If getRange('800:12344.0'), returns error.

Since the return of the getLastRow hass decimal point, could it be the reason? and How do I fix that?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda