Skip to content
Advertisement

Why is this ‘else if’ function not working with onEdit on Google Appscript?

I want to make it so whenever a cell in column 9 is edited, if the new cell value is different from “Ok”, the range “newRange” gets it value set to “Yes”; and if the new cell value is equal to “Ok”, “newRange” gets its content cleared.

Here’s my attempt:

JavaScript

The first part works great, but the content in “newRange” doesn’t get cleared if I change the value of a cell in column 9 to “Ok”. Can someone please tell me what I’m doing wrong? Thanks in advance.

Advertisement

Answer

Try this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement