如何允许 onEdit 函数影响 Google Sheet 中受保护的单元格? [英] How to allow onEdit function to affect protected cell in a Google Sheet?

查看:26
本文介绍了如何允许 onEdit 函数影响 Google Sheet 中受保护的单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有受保护范围的工作表,因此任何有链接的用户都可以编辑 A 列,还有一个 onEdit() 函数,该函数根据他们的输入写入 B 列,该函数受保护,因此只有我可以在登录时对其进行编辑.

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.

此保护可防止 onEdit() 为匿名用户执行其操作,因此 B 列永远不会设置其值.

This protection prevents the onEdit() from doing its thing for anonymous users so column B never has its value set.

你怎么能覆盖这个?我喜欢 excel 允许这样做的方式.

How can you override this? I like the way excel allows this.

推荐答案

您可以使用 可安装的触发器 在编辑时运行.这样的触发器以创建它的用户身份运行,而不管是谁的编辑导致它运行.因此,如果您是触发器的创建者并且您的帐户被授权编辑受保护的单元格,它们将被更新.

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.

这篇关于如何允许 onEdit 函数影响 Google Sheet 中受保护的单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆