問題描述
如何根據查看文檔的 Google 帳戶對 Google 表格中的列進行編程,使其從用戶輸入中灰顯 (How to program a column in Google sheets to be grayed out from user input depending on the Google account viewing the document)
我想根據誰打開此文檔來灰顯一列(例如,H 列) ‑ 就像根據正在查看或編輯此 Google 表格的 Google 帳戶一樣。
您可以如下圖所示,當除特定人員之外的任何其他人正在查看/編輯它時,我希望列 H 變灰(不隱藏但對用戶輸入禁用)。
參考解法
方法 1:
Take a look at protecting ranges, it will provide with just what you need to avoid users from editing a particular range of the sheet. In short, it work similar to file permissions, you can assign edit permissions in particular ranges so that only you (assuming you're the file owner) can edit in that range.
As for the coloring, I would advise against this, it could be achieved with a script, but if two users have the Sheet open at the same time (one with permissions, one without) one of them will see the column in a way they shouldn't. If you set the protected ranges, they will see a window telling them they cannot edit that cell.