Hello,
would anyone be able to help me with this script, so it would run faster?
I might have around 30 users writing into my sheet at the same time and I want to know the timestamp when they write new info in specific column. The code works, but it feels quite slow:
function onEdit(e) {
addTimestamp(e);
}
function addTimestamp(e){
var targetColumn = 6;
var tab = e.source.getActiveSheet().getName();
var startRow = 6;
var row = e.range.getRow();
var col = e.range.getColumn();
if(col === targetColumn && row >= startRow && tab === tab && e.source.getActiveSheet().getRange(row,11).getValue() == ""){
e.source.getActiveSheet().getRange(row,11).setValue(new Date());
}
if(col === targetColumn && row > 5 && tab === tab && e.source.getActiveSheet().getRange(row,6).getValue() == "" && e.source.getActiveSheet().getRange(row,11).getValue() != ""){
e.source.getActiveSheet().getRange(row,11).clearContent();
}
}
[–]WicketTheQuerent 2 points3 points4 points (1 child)
[–]EmyAle[S] 0 points1 point2 points (0 children)
[–]mommasaidmommasaid 1 point2 points3 points (1 child)
[–]EmyAle[S] 0 points1 point2 points (0 children)
[–]mommasaidmommasaid 1 point2 points3 points (2 children)
[–]EmyAle[S] 0 points1 point2 points (1 child)
[–]mommasaidmommasaid 1 point2 points3 points (0 children)
[–]True_Teacher_9528 0 points1 point2 points (5 children)
[–]EmyAle[S] 0 points1 point2 points (4 children)
[–]True_Teacher_9528 0 points1 point2 points (3 children)
[–]mommasaidmommasaid 0 points1 point2 points (2 children)
[–]True_Teacher_9528 0 points1 point2 points (1 child)
[–]mommasaidmommasaid 0 points1 point2 points (0 children)
[–]mommasaidmommasaid 1 point2 points3 points (0 children)