I cannot get this code to do what I am trying to get it to do. If there is a TRUE in Column 10 then run the Sort Query on SendToTotalSales - NOT ONLINERELOCATION
function MoveDonations(e) {
var sh=e.range.getSheet();
if(sh.getName()!='ONLINERELOCATION')return
if(e.range.columnStart==10 && e.value=="TRUE") {
e.source.getActiveSheet().getRange(row,????).setFormula('=SORT(QUERY(ONLINERELOCATION!A2:J,"SELECT A,
F, G, D",0))');
}
//var tsh=e.source.getSheetByName("SendToTotalSales");
//var trg=tsh.getRange(tsh.getLastRow()+1,1);
//sh.getRange(e.range.rowStart,1,1,4).copyTo(trg);
}
I am hoping I was Close !
Thanks in Advance
Select Certain Columns onEdit.. But in your question, it seems that you want to doIf there is a TRUE in Column 10 then run the Sort Query on SendToTotalSales. I have to apologize for my poor English skill. Can I ask you about your current issue and goal? - Tanaike'=SORT(QUERY(ONLINERELOCATION!A2:J,"SELECT A, F, G, D",0))'at the sheet ofSendToTotalSales, whenMoveDonationsis run by the OnEdit event trigger, you want to modify toe.source.getSheetByName("SendToTotalSales").getRange(row,????).setFormula(###). But from your question, I'm not sure where range you want to put the formula. I apologize for this. - Tanaike