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!