[英]How to allow onEdit function to affect protected cell in a Google Sheet?
I have a sheet that has protected ranges so any user with the link can edit column A, and an onEdit() function that writes to column B based on their input which is protected so only I can edit it when logged in. 我有一个具有受保护范围的工作表,因此任何具有该链接的用户都可以编辑A列,并且onEdit()函数根据其受保护的输入写入B列,因此只有我可以在登录时对其进行编辑。
This protection prevents the onEdit() from doing its thing for anonymous users so column B never has its value set. 这种保护可以防止onEdit()为匿名用户执行此操作,因此列B永远不会设置其值。
How can you override this? 你怎么能覆盖这个? I like the way excel allows this. 我喜欢excel允许的方式。
You can use an installable trigger running on edit. 您可以使用在编辑时运行的可安装触发器 。 Such a trigger runs as the user who created it, regardless of whose edit caused it to run. 这样的触发器以创建它的用户的身份运行,无论其编辑是否导致它运行。 So, if you are the creator of the trigger and your account is authorized to edit protected cells, they will be updated. 因此,如果您是触发器的创建者并且您的帐户有权编辑受保护的单元格,则会更新它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.