1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

スプレッドシートが特定の範囲で編集されたときにログを出す

Last updated at Posted at 2020-10-02

#前提
スプレッドシート編集時に発火するトリガーをセットしておくこと


const notice = () => {
  const user_email = Session.getActiveUser().getEmail();
  Logger.log(user_email);
  
  const Sheet = SpreadsheetApp.getActive();
  const Range = Sheet.getActiveCell();
  const cell_row = Range.getRow();
  const cell_column = Range.getColumn();
  const cell_value = Range.getValue();
  
  if((3 <= cell_row && cell_row <= 9) && (4 <= cell_column && cell_column <= 8) &&(cell_value === '●')){
 Logger.log('did it');
  }
}

onEdit で宣言するとSessionクラスが使えない模様。

参考にしてください。

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?