【发布时间】:2017-05-15 14:12:21
【问题描述】:
使用的 Google 表格是 here。
在“用药记录”标签下,有两个带有“+”和“-”号的按钮。
我想编写一个宏,当我点击“+”号时,单元格 M4 的值会加上 H4*x*y 的值,其中:
x = 1 if J4 = "od", "om" or "on"
= 2 if J4 = "bd"
= 3 if J4 = "td"
= 4 if J4 = "qd"
y = 7 if L4 = "Y"
= countif('Basic Info'!$B$17:$H$17,"x") if L4 = "N" (counting the number of x in the dialysis schedule under "Basic info" tab).
将对 M 列中的所有单元格执行相同的操作,从单元格 M4 向下。
同样,如果我点击“-”按钮,计算值将从 M4 向下的单元格中减去。
非常感谢有人可以协助编写代码,因为我是 Google App Script 的新手。
提前谢谢你!
【问题讨论】:
-
您好,感谢您的通知。我已经更新了链接。
标签: google-apps-script google-sheets-api google-sheets-query