LoginSignup
1
2

More than 3 years have passed since last update.

GASでA1セルに更新日付を表示させる

Posted at

スクリーンショット 2019-10-18 10.40.12.png

みんなで更新する書類で最終更新者が誰か?いつか?が必要なときに使う

function insertLastUpdated() {
  SpreadsheetApp.getActiveSheet()
    .getRange('A1') //挿入したいセル
    .setValue(
      '最終更新: ' + Utilities.formatDate(new Date(), 'JST', 'yyyy年MM月dd日HH時mm分') + //日時フォーマット
      ' by ' + Session.getActiveUser().getEmail() //更新したユーザーアカウント
    )
    .setFontColor('red'); //文字色
}
1
2
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
1
2