4
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 5 years have passed since last update.

【GAS@SpreadSheet】Google スプレッドシートを開く時に、Active セルを自動的にデータテーブルの底へ移動

Last updated at Posted at 2017-08-19

時系列の方式でレコードを記録する Google スプレッドシートには、一番新しい記録は通常データテーブルの一番下にあります。レコードを追加する時に、画面を下までスクロールする必要があります。データ量が多いほど、手間がかかります。当該のスプレッドシートを開く時に、Active セルを自動的に下まで移動する機能があれば便利だと思います。

Step 1:下記の GAS 関数を作成

function arrive_insertPoint() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sname = "sheet1";
  var sheet = ss.getSheetByName(sname);
  
  var lastRow = sheet.getLastRow(); //コンテンツを含む最後の行の行番号
  var activeRow = lastRow+1;
  var range = sheet.getRange("A"+activeRow.toString());
  range.activate();
}

####Step 2:トリガーを設定

  1. スクリプトエディタ>編集>すべてのトリガー>新しいトリガーを追加
  2. [実行]に上記の関数名を選択
  3. [イベント]に [スプレッドシートから]>[起動時]を選択し>保存
4
1
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
4
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?