2013-10-24 67 views
0

我有一個電子表格從Google Form收集我的表單響應。表格,過濾範圍和谷歌腳本

附加到此工作表的是一個腳本,它將每個新行拖出來,執行一些計算並將結果放入另一個工作表中。而不是每次複製整個片,我代替拉所述兩片的Δ用一塊的這樣的代碼:

/* 
* Any new entries within the Form Responses are added to the respective tab 
* by comparing the sizes of Form Responses and tab. 
*  
* The colParser argument defines the function that will extract the necessary columns. 
*/ 
function updateTab(tab, responses, colParser) { 

    var existingRows = tab.getDataRange().getNumRows(); 

    for (var i = existingRows; i <= responses.length - 1; i++) { 
    tab.appendRow(colParser(responses[i])); 
    } 
} 

的問題是,我也得到了應用到接收片材和所述過濾器每當我插入任何新數據時,過濾器範圍都不會更新。

有沒有辦法解決這個問題?作爲上述更新功能的一部分,是否可以通過編程方式更新過濾器範圍?

+0

建議你使用谷歌與應用程序腳本標記,爲你的代碼的應用程序,腳本代碼。 – eddyparkinson

回答

0

不要把過濾器放在接收表中。請改爲製作另一個工作表(選項卡)並使用查詢或篩選功能,如= query(data!a1:F;「select * where ....」)

0

修改您的公式,以便它不引用範圍的末尾。該範圍將自動添加添加的行中的任何內容。

錯誤:

=FILTER(A1:A4, B1:B4 > 0) 

右:

=FILTER(A1:A, B1:B > 0) 
相關問題