程式碼
function onEdit(e){
var activeSheet = e.source.getActiveSheet();
var cell = e.range;
var col = cell.getColumn();
if(cell.getFormula() !==""){
var destination = activeSheet.getRange(2,col,activeSheet.getLastRow()-1,1);
cell.copyTo(destination);
}
}
錯誤信息
TypeError: Cannot read property 'source' of undefined