I found the following code in another post here to add a date after an edit but it places it in an offset column, I would like the date in Column 8 if column 3 or 4 has been edited.
What do I change?
function onEdit(e) {
if ([3,4].indexOf(e.range.columnStart) != -1) {
e.range.offset(0, 1).setValue(new Date());
}
}
Best Answer
then try
e.range.offset(0, 7)
to have dates only in one column try like this:
"Sheet1"
= sheet namer.getColumn() == 3
= column C / 3rd columnr.offset(0, 7)
= offset timestamp 7 columns to the right on the same row eg column H"GMT+8"
= timezone"MM/dd/yyyy hh:mm:ss"
= date and time formatalternative (untested):