I have a google sheet that I want to add a time stamp every time a cell was updated. I have the basic code down:
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
var c = s.getActiveCell();
var cell1 = 13
if(c.getColumn() != cell1 ) {
var row = c.getRow();
var time = new Date();
time = Utilities.formatDate(new Date(), "EST", "MM-dd-yyyy HH:mm:ss");
SpreadsheetApp.getActiveSheet().getRange(row,cell1).setValue(time);
};
};
But I want to only trigger it on 1 sheet called "VariableMaster" so I tried:
if(c.getColumn() != cell1 && s == "VariableMaster") {....
I also tried adding another if statement below that
if(c.getColumn() != cell1 ) {
if(s.getActiveSheet == "VariableMaster"){...
Both attempts breaks the function and it doesn't add the time stamp to any sheet. Thanks!