I found a youtube video to automatically add the date when a checkbox was updated. It seemed like it worked, but now as I look, the "daily summary" page that counts by date and department, is not counting correctly. I tried formatting, but doesn't do anything.
In this script, column 15 is where I have the checkbox, column 17 is where the date is entered (which does work - although if you uncheck the box, the date remains), but, again, the check/date entries are not counted on the summary page.
Any ideas?
In this script, column 15 is where I have the checkbox, column 17 is where the date is entered (which does work - although if you uncheck the box, the date remains), but, again, the check/date entries are not counted on the summary page.
Any ideas?
Code:
function onEdit(e) {
addTimestampRL(e)
}
function addTimestampRL(e) {
//variables
var startRow = 2;
var targetColumn = 15;
var ws = "Renovo (Internal)";
//get modified row and column
var row = e.range.getRow();
var col = e.range.getColumn();
if(col === targetColumn && row >= startRow && e.source.getActiveSheet().getName() === ws){
var currentDate = new Date();
if(e.source.getActiveSheet().getRange(row,17).getValue() == ""){
e.source.getActiveSheet().getRange(row,17).setValue(currentDate);
}
}
}