我只使用一个脚本将setValue设置为“”,然后设置一个Importrange公式。 基本上我这样做是为了让数据更新更快,因为我将为每5分钟设置一次触发器。
我收到一条关于缺少括号的错误消息。 我已经读过关于将“+”插入字符串但我不知道如何将其添加到此表达式中。
任何人都可以帮助我吗?
*function UpdateTarget() { var ss = SpreadsheetApp.getActive(); var sheet = ss.getSheetByName("Teste"); sheet.getRange("B4").setValue(""); sheet.getRange("B4").setFormula("=importrange("1pG8nVt-wB4Sf4KvaXT_-0";if(day(today()-weekday(today())+2)<10;"0"&day(today()-weekday(today())+2);day(today()-weekday(today())+2))&"."&if(month(today()-weekday(today())+2)<10;"0"&month(today()-weekday(today())+2);month(today()-weekday(today())+2)) &"."&if(year(today()-weekday(today())+2)<10;"0"&year(today()-weekday(today())+2);YEAR(today()-weekday(today())+2))&"!BY34:KF83")"); }*提前致谢!
蓝天,
I'm stuck with a single script just to setValue as "" and then set a formula of Importrange. Basically i'm doing this to have the data update quicker as i will set a trigger for each 5 minutes.
I'm receiving an error message about missing parenthesis. I've read about inserting the "+" into string but i don't see how can i do it into this expression.
Can anyone help me out on that?
*function UpdateTarget() { var ss = SpreadsheetApp.getActive(); var sheet = ss.getSheetByName("Teste"); sheet.getRange("B4").setValue(""); sheet.getRange("B4").setFormula("=importrange("1pG8nVt-wB4Sf4KvaXT_-0";if(day(today()-weekday(today())+2)<10;"0"&day(today()-weekday(today())+2);day(today()-weekday(today())+2))&"."&if(month(today()-weekday(today())+2)<10;"0"&month(today()-weekday(today())+2);month(today()-weekday(today())+2)) &"."&if(year(today()-weekday(today())+2)<10;"0"&year(today()-weekday(today())+2);YEAR(today()-weekday(today())+2))&"!BY34:KF83")"); }*Thanks in advance!
Blue skies,
最满意答案
你只是有不匹配的报价。 在双引号内使用单引号。 它只是一个标准的JavaScript语法错误。
You simply have mismatched quotes. Use single quotes inside the double quotes. Its just a standard javascript syntax error.
更多推荐
发布评论