I am the author of the article you quote here. I don't use StackOverflow often enough to add this in the comments, I believe the preference here is to do so.
Please note that the ss
variable refers to the active spreadsheet. This is the spreadsheet tied to script . Because we are using onEdit()
trigger, this script needs to be bound to Google Sheets. Based on your question, I'm not sure if you've already done this, but here are the instructions to accomplish it:
In your Google Sheets menu, go to >Extensions>Apps Script.
Here, paste the code and save the project. Make sure your sheet name (the name in the tab) is the same as the sheet name you wish to modify and update, and update the SHEET_NAME
variable accordingly.
This should resolve the error you are experiencing.
NOTE - The code breakdown below the main code is only intended to highlight some important parts of the code and is not a step-by-step guide. I've updated the post with this in mind and appreciate your feedback.
I apologize if I misunderstood your question.
Tanaike - If you think this is more appropriate, please feel free to delete this reply or merge it into a comment instead of posting it here.