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

88
Views
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
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!