function onEdit(e) { var editedSheet = e.source.getActiveSheet(); var editedCell = e.range; var row = editedCell.getRow(); var col = editedCell.getColumn(); var ySheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Y_output"); //Check if edit is done in Sheet "X_input" if(editedSheet.getName()=="X_input"){ //copy modified cell to Y_output sheet ySheet.getRange(row,col).setValue(e.value); //check if modified cell is within B2:Y61 range and send an email if(row>=2 && row<=61 && col>=2 && col<=25){ //Send email var subject = "Sheet: "+editedSheet.getName(); var message = "Cell "+editedCell.getA1Notation()+" was modified from '"+e.oldvalue+"' to '"+e.value+"'"; MailApp.sendEmail("ronoel@google.com",subject,message); } } }