I have a simple sheet that has two columns with tick boxes in them (columns 5 and 8) The goal is when the box is ticked the date and time are inserted in the column next to it. I have got it working correctly with one column with the following code:
function onEdit(e) {
var aCell = e.source.getActiveCell(), col = aCell.getColumn();
if(col == 5) {
var adjacentCell = aCell.offset(0, 1);
var newDate = Utilities.formatDate(new Date(),
"GMT+1", "dd/MM/yyyy kk:mm:ss");
adjacentCell.setValue(newDate);
}
}
For the life of me, I can't work out how to modify that so that it works with column 8 as well. Any help will save me tearing my hair out!