LoginSignup
3
3

More than 5 years have passed since last update.

Google Spread Sheetのセルの更新時刻を表示する

Last updated at Posted at 2018-07-13

スクリプトを作る

  1. Google Spread Sheet > ツール > スクリプトエディタ
  2. エディタに以下のコードを記述します。
function insertLastUpdated() {
  var sheet =  SpreadsheetApp.getActiveSheet()
  var cell = sheet.getRange(sheet.getLastRow(), 2)
  if (cell.getValue() == "") {
    cell.setValue(Utilities.formatDate(new Date(), 'JST', 'HH時mm分ss秒'))
  }
}

スクリーンショット 2018-07-13 12.59.31.png

トリガーを作る

  1. スクリプトエディタのメニュー > 編集 > 現在のプロジェクトのトリガー
  2. 以下の設定で保存します。

スクリーンショット 2018-07-13 12.56.24.png

動作確認

スプレッドシートのA列の最終行のセルに値を書き込むと、B列に更新日が書き込まれるようになりました。

スクリーンショット 2018-07-13 12.57.31.png

3
3
0

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
3
3