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

87
Vistas
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 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