Answer the question
In order to leave comments, you need to log in
How, when editing a cell, to check for the presence of fullness in another cell, and if it is empty, enter the exact date there at a given moment?
I want that when entering text into any cell from B2 except for the first two, the exact date when I wrote it down would fit into the cell from A1 on the left, and during the next edits of the cell from B2, the date of the first editing of this cell would remain, but I don’t know how to do it, it was would be very grateful!
Answer the question
In order to leave comments, you need to log in
function onEdit(e) {
var sheetName = "Лист1";
var sh = as.getActiveSheet().getName();
var activeCell = sheet.getActiveCell();
var col = activeCell.getColumn();
var row = activeCell.getRow();
var colChange = 5; // Колонка которую редактируют
var colLogDate = 7; // Колонка в которую записывают дату и время редактирования
if ((col == colChange)&&(sh == sheetName )) {
sheet.getRange(row, colLogDate).setValue(new Date()).setNumberFormat('dd.MM.yyyy hh:mm:ss ');
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question