このコードに機能を追加するのに助けが必要です。これまでのところ、C 2 が変更されると、D 2 に日付スタンプが追加されますが、C 2 のコンテンツをクリアするときに日付スタンプをクリアしたいのですが、これをうまく達成できませんでした。
どんな助けでも大歓迎です。
ありがとう。
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Add Payroll" ) {
//checks that we're on the correct sheet
var r = s.getActiveCell();
if( r.getColumn() == 3 ) {
//use getRow for row and getColumn
for column
var nextCell = r.offset(0, 1);
//offset (row,column)
if( nextCell.getValue() === "" )
//is empty?
nextCell.setValue(new Date());
//will only put date, format "123/Date and time" if time needed
}
}
}