2013-04-06 15 views
0

我想setformula使用谷歌腳本和它的不工作的單元格。我有幾個條件和雙引號,並不知道如何向工作表添加雙引號。setFormula使用腳本的單元格不工作

=if(B17<>"",IF(Form!B8 = "","",IF(Form!B8 = "Representative",index(House!A:H,MATCH(B17,House!G:G,0),8),index(House!A:H,MATCH(B17,Senate!G:G,0),8))),"") 

如何將此公式添加到單元格?

回答

2

您是否試圖用單引號將其包圍?

這樣的:(更新範圍值)

sheet.getRange(1,1).setFormula('=if(B17<>"",IF(Form!B8 = "","",IF(Form!B8 = "Representative",index(House!A:H,MATCH(B17,House!G:G,0),8),index(House!A:H,MATCH(B17,Senate!G:G,0),8))),"")') 
+0

大,合作。非常感謝 – Taizooooon 2013-04-06 18:07:13