I have a Planning sheet that I use to follow budgets that are reported every week.
I'd like to have K7:18 stamped with a date when there is a change in the corresponding cell of I7:I18 range.
I cannot use onEdit function cause of other scripts currently running. I had no luck with onChange until now, though I'm not skilled with Google Apps Script.
-
Welcome to Web Applications Stack Exchange.– doubleunaryCommented Nov 2, 2023 at 16:28
-
Per your comment "When I started expanding the datasets within the spreadsheet, it would execute "successfully" but the dates would be updated sporadically. After days of troubleshooting I had to give up on the approach." it would helpful to understand more about the data as well as the other script.– Blindspots ♦Commented Nov 2, 2023 at 21:41
Add a comment
|
1 Answer
When you have two onEdit(e)
functions in the same script project, it is indeed the case that only one of them will run.
The simplest pattern to combine two onEdit(e)
functions is to rename the existing functions to doFirstThing_(e)
and doSecondThing_(e)
, and then call them like this:
function onEdit(e) {
doFirstThing_(e);
doSecondThing_(e);
}
Alternatively, use a timestamp script that can handle multiple sheets and ranges, such as my yetAnotherTimestamp_ script.
-
Thank you for the quick response! I've already tried this approach, and for unknown reason it does not work reliably. When I started expanding the datasets within the spreadsheet, it would execute "successfully" but the dates would be updated sporadically. After days of troubleshooting I had to give up on the approach. I'll take a look at your script. Thanks! Commented Nov 2, 2023 at 16:27