0
我有一個google文檔的onEdit腳本,我只希望它能在一張紙上工作。如何更改腳本,使其僅適用於工作表中的其中一張工作表?這裏是我的代碼:使onEdit僅適用於一張工作表
function onEdit(event)
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SpreadsheetApp.getActiveSheet();
var CellRow = SpreadsheetApp.getActiveRange().getRow();
var CellColumn = SpreadsheetApp.getActiveRange().getColumn();
if (CellColumn == 2 && CellRow == 3){
sheet.getRange(CellRow, CellColumn).setFormula("=ArrayFormula(QUERY(ImportRange(\"0AmH7M5970cwZdHFRa3NITkdBSFhxd3JzYUZwbFRId3c\";\"Table!B2:J200\");\"select Col1 where Col1 = \'\"&$K$13&\"\' limit 1\"))");
Browser.msgBox("DON'T MESS WITH THE FORMULAS!");
}
}
這裏也是鏈接到谷歌文檔:https://docs.google.com/spreadsheet/ccc?key=0AiZUQMvsVudJdFpMbjdJTlpzVGxacDl4YlRyV2NaZ1E#gid=0 – user1443553
沒關係,我有本網站上的答案是:http:/ /www.codingforums.com/showthread.php?p=1239551#post1239551 – user1443553