我在谷歌電子表格,我知道如何創建一個新的菜單項,但一個人如何執行與谷歌電子表格appscript代碼如下:在Google Spreadsheets中,如何在用戶點擊並激活單元格後,從另一個單元格的值中設置單元格的值?
If in cell A2, I click a menuitem "SetValue", then A2's cell value is set with value from A1. If in cell B2, I click a menuitem "SetValue", then B2's cell value is set with value from B1. If in cell C2, I click a menuitem "SetValue", then C2's cell value is set with value from C1. ... (and so forth and so on)
請記住,用戶可以隨機在啓動菜單項功能之前,單擊第2行中的任何單元格。
這將失敗的列> 26 ...(使用2個字母的A1表示法) –
感謝您指出,並沒有意識到 – AshClarke
也:行是一個字符串,當您檢查行時,您必須添加引號以獲得相同的條件== 2。爲了方便,我在另一個答案中寫了一個工作版本。 –