我正在做的專案是計算手機游戲中剩余套裝的成本。它有一個電子表格,其中包含所有集合的串列,以及所有 5 個部分的復選框,列 B:F。我想包括隱藏所有已完成設定的選項,因此所有復選框都被選中。這是通過另一個復選框 H16 完成的。
我已修改復選框值以使用是和否。
我以前從未使用過 Google Apps 腳本,并且對一般的編碼非常陌生。我想我需要的是,使用 onEdit,然后每次編輯單元格時,檢查 H16 是否為 TRUE,然后掃描每一行以檢查 B:F 值。如果全部為真,則隱藏該行。不過,我不知道輸入它的最佳方法。
加分項,我還想包括一個重置復選框,因此選中時,將 B:F 中的所有值設定為 false,并顯示行。

我在除錯腳本時使用 K1 為我提供事件物件。我還在多個位置使用 e.source.toast 來了解正在發生的事情。
影片片:

事件物件的不完整描述
通過使用我的示例中所示的 JSON.stringify 代碼,您可以更好地理解事件物件。
Most new people want to run the code from the script editor so I'll tell upfront that unless you provide the event object to populate the e then it's not going to work. Just copy and past it and get you unique stuff set like sheet name and data space and then proceed to edit the page and figure out how it works.
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/328227.html
