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

89
Visualizações
Issue with Google Apps Script not performing correcty

Desired result: a function that will move an entire row that contains "Ω" in column 5, to the bottom of the sheet.

I found and slightly edited this script from here. It essentially copies the desired row to the bottom of the sheet and then deletes that row from its current position.

The problem? When I add the "Ω" to the cell located at (current row, column 5), it copies the row correctly and deletes it, but then also performs the script on the following row as well despite it not being edited at all. I can't tell if the issue is in the code or the issue is the size of the sheet (3000+ rows) and its slow performance is lagging the script.

function onEdit(e) {
  const row = e.range.getRow();
  const col = e.range.getColumn();
  const sheet = e.source.getActiveSheet();
  const lastcol = sheet.getLastColumn();

  if(sheet.getName() == "US" && col == 5  && row > 2 && sheet.getRange(row,col).getValue().includes("Ω")) {              
    var row_new = sheet.getRange(row, 1, 1, lastcol);
    row_new.copyTo(sheet.getRange(sheet.getLastRow() + 1, 1, 1, lastcol));
    sheet.deleteRow(row);
  }
}

Any help or suggestions are appreciated!

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