0
2

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.

Google Apps Script でスプレッドシートにカスタムメニューを追加する話

0
Posted at

はじめに

Google Apps Script(GAS)のトリガーを使って、スプレッドシートにカスタムメニューを追加することができます。

Apps Script リファレンス

onOpen(e)

トリガーを使用

GAS のトリガー onOpen(e) はユーザーが Google ドキュメント、スプレッドシート、スライド、フォームのファイルを開いたときに自動的に実行されます。
この関数を使用して独自のメニューを追加します。

function onRefresh() {
  // do something
}

/* ファイルを開いたときのイベントハンドラ */
function onOpen() {
  var ui = SpreadsheetApp.getUi();
  var menu = ui.createMenu("ワークフロー");
  menu.addItem("データを更新", "onRefresh");
  menu.addToUi();
}
0
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
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?