Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

175
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda