1

我发现在 Google 表格中创建复选框并不是一个好方法。当单击单元格时,有没有办法将 X 或复选标记的脚本放置在单元格中?我希望脚本适用于第 5 列中的所有单元格。

4

2 回答 2

1

不,没有。您可以使用菜单将 X 放在选定的单元格上,但不能放在单元格单击上。

于 2013-10-26T15:23:38.207 回答
-3

有没有办法让时间在单击时自动填充单元格?当编辑左侧的单元格时,我使用以下脚本自动填充时间。

function onEdit(e) {
  var s = e.source.getActiveSheet(), r, colCell, nextCell;
  if(s.getName() === 'SignInOut') { //checks that we're on the correct sheet
    r = e.range; //s.getActiveCell();
    colCell = r.getColumn();
    if(colCell === 3 || colCell === 5) { //checks the column
      nextCell = r.offset(0, 1);
      if(nextCell.getValue() === '') //is empty?
        nextCell.setValue(new Date());
    }
  }
}
于 2013-10-28T02:49:27.407 回答