Help us understand the problem. What is going on with this article?

SpreadSheet にてシートの最終更新日時を自動挿入する GoogleAppScript

More than 3 years have passed since last update.

下記のようにシート毎の最終更新日時がA1セルに自動的に挿入されるようになります。

image

やり方

  1. 挿入したいスプレッドシートのメニューから AppScriptの編集画面を開く
    image

     

  2. 下記AppScriptを設定する

    Code.gs
    function insertLastUpdated() {
      SpreadsheetApp.getActiveSheet()
        .getRange('A1') //挿入したいセル
        .setValue(
          '最終更新: ' + Utilities.formatDate(new Date(), 'JST', 'yyyy年MM月dd日HH時mm分ss秒') + //日時フォーマット
          ' by ' + Session.getActiveUser().getEmail() //更新したユーザーアカウント
        )
        .setFontColor('red'); //文字色
    }
    
  3. スプレッドシートのトリガーを設定する
    image
     
    image

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした