I'm trying to work out a google scripts onEdit function that is only triggered by one specific column, and will set the value in the same row on the next column.
The script should set the value (new Date()) in column D when a cell in column C is edited, and should be limited to rows after row 7.
Currently I have one that kinda works, but it works when you edit any cell in the sheet, so it's not ideal. I've been googling and reading for a while to no avail. Any help would be greatly appreciated.
Here's the code I currently have:
function onEdit() { //Function to add a time stamp to Complete Time Column D
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var range= sheet.getActiveCell();
var row = range.getRow();
if(row>7){
sheet.getRange(row, 4).setValue(new Date());
}
}