I have an onEdit script that has previously been working fine to put a timestamp in a cell based on edits of a certain cell in the same row. Up until about two days ago, the runtime was about a second, maximum, usually within the 0.2-0.3 seconds range. In the last two days, it has been timing out at 30 seconds. I made no changes to the script itself, although I have been making some changes to the rest of the workbook (but nothing that I feel should interrupt the script?). Script included below-- can I make any changes to make this work, or is there anything that could be in my book that is affecting the script's functionality?
function onEdit(e) {
var row = e.range.getRow();
var col = e.range.getColumn();
if(e.source.getActiveSheet().getName() === "OEEMG" && col === 14 && row > 3){
e.source.getActiveSheet().getRange(row, 16).setValue(new Date ());
}
else if(e.source.getActiveSheet().getName() === "OEOL" && col === 14 && row > 3){
e.source.getActiveSheet().getRange(row, 16).setValue(new Date ());
}
else if(e.source.getActiveSheet().getName() === "AALDV" && col === 8 && row > 3){
e.source.getActiveSheet().getRange(row, 16).setValue(new Date ());
}
else if(e.source.getActiveSheet().getName() === "AdInq" && col === 12 && row > 3){
e.source.getActiveSheet().getRange(row, 18).setValue(new Date ());
}
}
Thanks in advance!
e.source.getActiveSheet()
bye.range.getSheet()
, once said that, troublehshooting like questions are off-topic on this site... consider to post a question on Stack Overflow but bear in mind that it's very likely that you will be required to add a "mcv", meaning that you should try first to reproduce the problem and add all the details necesary for others to reproduce the same problem.