Answer the question
In order to leave comments, you need to log in
Is it possible in Google Sheets to somehow capture the date a cell value was modified?
The point is that you need to know at what time the value in the cell was changed, so that when transferred to the next sheet through the filter function, the line gets to the bottom of the array, and not somewhere else.
If there is another solution to this problem, I will be glad to know.
Answer the question
In order to leave comments, you need to log in
You just need to look at the onedit trigger, check which cell is being edited and if you need it, then simply write the date of the change in the desired cell.
look here
Formulas cannot store cell state, so scripts must be used.
The general code looks like this
function myFunction(e) {
try {
if (!e || !e.range) return;
if (e.range.columnStart > 1) {
var targetCell = SpreadsheetApp.getActiveSheet()
.getRange(e.range.rowStart, 1, e.range.rowEnd - e.range.rowStart + 1);
/* if you want insert the date once uncomment the row below
*
**/
// if(!targetCell.getValue())
targetCell.setValue(new Date());
}
} catch (err) {
SpreadsheetApp.getActiveSpreadsheet().toast(err.message, 'Error!!1');
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question