hi to all
I was trying for a script, so if any filling in the "name" column B, there will be a stamp time in "time in" column D & also for (status & "time out") column's (G&E), with keeping the time static for any changes in column(B&G) - I have a script and link below for what i need , but i don't now why the time appear also in c column
link: TIME STAMP2
script:
function onEdit(e) {
var rng = e.range;
var sheet = rng.getSheet().getSheetName()
//1.Change 'Sheet1' to be matching your sheet name
if (sheet =='Sheet1') {
switch(rng.getColumn()){
// if column B changed add timestamp in column D
case 2:
rng.offset(0,2).setValue(new Date()); //.setNumberFormat("MM/dd/yyyy hh:mm");
// if column G changed add timestamp in column H
case 7:
rng.offset(0,1).setValue(new Date()); //.setNumberFormat("MM/dd/yyyy hh:mm");
break;
default:
break;
}
}
};
I was trying for a script, so if any filling in the "name" column B, there will be a stamp time in "time in" column D & also for (status & "time out") column's (G&E), with keeping the time static for any changes in column(B&G) - I have a script and link below for what i need , but i don't now why the time appear also in c column
link: TIME STAMP2
script:
function onEdit(e) {
var rng = e.range;
var sheet = rng.getSheet().getSheetName()
//1.Change 'Sheet1' to be matching your sheet name
if (sheet =='Sheet1') {
switch(rng.getColumn()){
// if column B changed add timestamp in column D
case 2:
rng.offset(0,2).setValue(new Date()); //.setNumberFormat("MM/dd/yyyy hh:mm");
// if column G changed add timestamp in column H
case 7:
rng.offset(0,1).setValue(new Date()); //.setNumberFormat("MM/dd/yyyy hh:mm");
break;
default:
break;
}
}
};