[英]Set formula for each new tab/sheet
我正在嘗試為每個新標簽分配一個公式。 元素列表后出現錯誤代碼(缺少)(第10行,文件“代碼”)
function makeTabs() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var last = sheet.getLastRow();//identifies the last active row on the sheet
//loop through the code until each row creates a tab.
for(var i=1; i<last; i++){
var tabName = sheet.getRange(i+1,9).getValue();//get the range in column I and get the value.
var create = ss.insertSheet(tabName);//create a new sheet with the value
var formulas = [
['=transpose('Form Responses 1'!J2:O2)'],
['=Arrayformula(IF(A2:A="",,VLookup(A2:A,ImportedData!A1:S,{2,11,15,18,17,19},0)))']] ;
var cell = sheet.getRange("A2:B2");
cell.setFormulas(formulas);
}
}
我要去哪里錯了? 謝謝!!
嘗試像這樣轉義內部單引號:
['=transpose(\'Form Responses 1\'!J2:O2)']
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.