Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Insert timestamp in row when formula result changes in the same row in Google Sheets

$
0
0

I am trying to add a timestamp when a particular cell returns TRUE. With help from this community, I was able to modify the code below. It works perfectly if I type in TRUE. However, when a formula's result returns TRUE, it does not work. I must be doing something wrong.

Here is the code:

function onEdit() {    var s = SpreadsheetApp.getActiveSheet();    if( s.getName() == "Campaign" ) { //checks that we're on the correct sheet    var r = s.getActiveCell();    if( r.getColumn() == 17 ) { //checks the column        var nextCell = r.offset(0, 10);        if( r.getValue() === true)            nextCell.setValue(new Date()).setNumberFormat('MM/dd/yyyy');        }    }}

Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>