I have two scripts that I am trying to run simultaneously that will organize two different columns based on their cell value. Both functions work, I'm just unsure how to combine the two
Could someone please help me?
function onEdit(e) {
const src = e.source.getActiveSheet();
const r = e.range;
if (r.columnStart != 9 || r.rowStart == 1 || e.value == src.getName()) return;
const dest = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(e.value);
src.getRange(r.rowStart,1,1,9).moveTo(dest.getRange(dest.getLastRow()+1,1,1,9));
src.deleteRow(r.rowStart);
}
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Opened");
var range = sheet.getRange("J2:J100");
function onEdit(e) {
range.sort([{column: 10, ascending: false}]);
}
I have tried combining both formulas however, I am aware that I cannot have two onEdit functions.