Academy ↓
Timestamp When Done on Certain Sheet
This is a version of Timestamp when Done that adds a Sheet to the mix to make sure we're on the right sheet.
function onEdit(edit) {
var row = edit.range.getRow()
var column = edit.range.getColumn()
var newValue = edit.value
var sheetName = SpreadsheetApp.getActiveSheet().getSheetName()
var columnWeWant = 2
var textWeWant = "Done"
var timestampTimeZone = "GMT-5"
var timestampFormat = "yyyy-MM-dd'T'HH:mm:ss"
var nameofSpreadsheet = "Sheet1"
if(column == columnWeWant && row >=2 && newValue == textWeWant && sheetName == nameofSpreadsheet ){
var timestamp = Utilities.formatDate( new Date(),timestampTimeZone, timestampFormat)
SpreadsheetApp.getActiveSpreadsheet().getSheetByName(nameofSpreadsheet).getRange(row,3,1,1).setValue(timestamp)
}
}