function onEdit(e) { var ss = SpreadsheetApp var sh = ss.getActiveSpreadsheet() var sh1 = sh.getSheetByName('แผ่น1') var sh2 = sh.getSheetByName('แผ่น2') var cell = e.range var value = cell.getValue() var curRow = cell.getRow() var curCol = cell.getColumn() var sheets = ['แผ่น1', 'แผ่น2'] var colEdit = [1, 2,3] if (sheets.indexOf(ss.getActiveSheet().getName()) > -1 && colEdit.indexOf(curCol) > -1 && curRow > 1) { sh1.getRange(curRow, curCol).setValue(value) sh2.getRange(curRow, curCol).setValue(value) } }