GAS スプレッドシートの名前を変更する
- 作成日 2022.10.25
- Google Apps Script
- Google Apps Script

GAS(Google Apps Script)で、スプレッドシートの名前を変更する手順を記述してます。「rename()」メソッドを使用すれば名前を変更できます。実際にGASを作成したスプレッドシートで実行してます。
環境
- OS windows11 home
- ブラウザ chrome 106.0.5249.103
名前を変更
スプレッドシートの名前を変更するには、「rename()」を使用します。
spreadsheet.rename("名前")
以下の、「sample」というスプレッドシートの名前を変更してみます。

コードを実行します。
function myFunction() {
// GASを作成したスプレッドシート
let spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
// スプレッドシートの名前を変更
spreadsheet.rename("foo")
}
「foo」に変更されていることが確認できます。

-
前の記事
sakuraエディタ ステータスバーの表示・非表示を切り替えるショートカットキー 2022.10.25
-
次の記事
CentOs9 Mysqlのインストール手順 2022.10.25
コメントを書く