I got the major part of answer on this link:
Google Spreadsheet Timestamp?
The code on this link is below:
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Sheet1" ) { //checks that we're on the correct sheet
var r = s.getActiveCell();
if( r.getColumn() == 13 ) { //checks the column
var nextCell = r.offset(0, 1);
if( nextCell.getValue() === '' ) //is empty?
var time = new Date();
time = Utilities.formatDate(time, "GMT", "HH:mm:ss");
nextCell.setValue(time);
};
};
}
I want a little modification to third line of code which I cant achieve. I want to apply the same code to sheet1, sheet4, and sheet 10. How I can do that?
Best Answer
See if this works: