r/GoogleAppsScript • u/Upset_Mouse3193 • Apr 14 '25
Question Script very slow - How to speed up?
I have a script which is very simple but takes about 14 seconds to run. Anyway to speed it up?
Script:
function onEdit(e){
if(e.range.getA1Notation() == 'E46' &&
e.range.getSheet().getName() == 'NetWorth Dashboard'){
e.source.getRange('H46').clearContent();
}
}This is in a workbook with 40 sheets. The E46 is a selector via data validation for a chart and H46 is a data validation list that changes bases on E46. So once E46 changes, anything selected in H46 is invalid and so needs to be cleared out.
TIA.
1
Upvotes
View all comments
Show parent comment
1
u/Upset_Mouse3193 Apr 14 '25
Thanks. I few nit picks in the code but it saved me 2 seconds. Now only taking 12 seconds to complete.
`