仅当单元格填写“是”时才获取日期

时间:2020-07-18 01:39:03

标签: google-apps-script google-sheets

我需要更改以获取仅用单词“ YES”更新B列的日期。

function onEdit() {
  var s = SpreadsheetApp.getActiveSheet();
  if (s.getName() == "EXPORTACION") { //checks that we're on Sheet1 or not
    var r = s.getActiveCell();
    if (r.getColumn() == 2) { //checks that the cell being edited is in column B
      var nextCell = r.offset(0, 1);
      if (nextCell.getValue() === 'YES') //checks if the adjacent cell is empty or not?
        nextCell.setValue(new Date());
    }
  }
}

1 个答案:

答案 0 :(得分:1)

 def f(*args):
    x= args[0]
    y= args[1]
    return x+y

p = Process(target=f,args=??)