メインコンテンツへスキップ

Googleスプレッドシートでシート名のリストを取得するにはどうすればよいですか?

この記事では、現在のシート名の名前またはGoogleスプレッドシートのシート名のリストを取得するためのいくつかの方法を紹介します。

スクリプトを使用してGoolgeシートの現在のシート名を取得します

スクリプトを使用してGoogleスプレッドシートのシート名のリストを取得する


スクリプトを使用してGoolgeシートの現在のシート名を取得します

Googleスプレッドシートで現在のシート名を取得するには、次の簡単なスクリプトを使用すると、名前を手動で入力しなくても役立ちます。次のようにしてください。

1に設定します。 OK をクリックします。 ツール > スクリプトエディタ、スクリーンショットを参照してください:

doc get シート名 1

2。 開いたプロジェクトウィンドウで、以下のスクリプトコードをコピーして空白に貼り付けます Code ウィンドウ、スクリーンショットを参照してください:

function sheetName() {
  return SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getName();
}

doc get シート名 2

3。 次に、コードウィンドウを保存し、名前を取得するシートに戻って、次の式を入力します。 =sheetname() セル内で、を押します 入力します キーを押すと、シート名がすぐに表示されます。スクリーンショットを参照してください。

doc get シート名 3


スクリプトを使用してGoogleスプレッドシートのシート名のリストを取得する

Googleスプレッドシートのすべてのシート名を取得したい場合は、次のスクリプトを使用してください。次のようにしてください。

1に設定します。 OK をクリックします。 ツール > スクリプト エディタでプロジェクトウィンドウに移動し、以下のスクリプトコードをコピーして空白に貼り付けます Code ウィンドウ、スクリーンショットを参照してください:

function sheetnames() { 
  var out = new Array()
  var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
  for (var i=0 ; i<sheets.length ; i++) out.push( [ sheets[i].getName() ] )
  return out  
}

doc get シート名 4

2。 次に、コードウィンドウを保存し、すべてのシート名を取得するシートに戻って、次の式を入力します。 =sheetnames() セル内で、を押します 入力します キーを押すと、Googleスプレッドシートのすべてのシート名が次のスクリーンショットのように表示されます。

doc get シート名 5


すべてのシート名を一覧表示し、Excelブックのハイパーリンクまたはボタンを使用してシート間を移動します。

Kutools for Excel's シート名のリストを作成する ユーティリティを使用すると、ハイパーリンクまたはマクロボタンを使用して、すべてのワークシート名を新しいシートにすばやく一覧表示し、必要に応じてそれらの間を移動できます。

Kutools for Excel:300以上の便利なExcelアドインがあり、30日以内に制限なしで無料で試すことができます。 今すぐダウンロードして無料トライアル!

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (21)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thanks :)))
This comment was minimized by the moderator on the site
This script in Google Sheets works great! However, sheetnames() doesn't seem to update when new sheets are added or sheets are renamed. Is there a way to make it refresh?
This comment was minimized by the moderator on the site
why is it not working for me?i have copied the scripts and they seem so run with no errors, but when i go to google sheets, it dosent show the function "sheetsname"
This comment was minimized by the moderator on the site
Save the script and run
This comment was minimized by the moderator on the site
How to export all sheet names in open excel file to Google Sheet? Thank you
This comment was minimized by the moderator on the site
How to export all sheet names in open excel file to Google Sheet?
This comment was minimized by the moderator on the site
works for me! Thanks!!!
This comment was minimized by the moderator on the site
TypeError: Cannot read property 'getSheets' of null (riadok 3, súbor Kód)
This comment was minimized by the moderator on the site
Sorry.I did something wrong.It is already working fine.
This comment was minimized by the moderator on the site
Hey, may i know what is your mistake? i have the same error
This comment was minimized by the moderator on the site
Hi.
Of course You can.
I created a script using the Google Script Manager (script.google.com) and thought it would work automatically on all sheets in my google drive, but that wasn't true.Probably a script created throught Google Script Manager, not throught sheet, is not linked to a sheet.I had to create a script via menu in the top bar in the open Google Sheets "Tools / Script Editor" and the function I created works only in that given sheet.Please write if this solved your problem.
:)
This comment was minimized by the moderator on the site
Hello,


Ive registered an account just to say, ive found a way to automatically update this function, its a cheat really.



In cell C!, ive put a checkbox.

At my header of sheet names, I put this code.



=if(C1=true,sheetnames(),)


Then, when we edit a tab name or create a new one, we uncheck the box and check it again and it is done, not perfect, but better than deleting the cell and re-pasting.


Thank you


Charlie.

EDIT , i tried inserting picture, but it seems to disappear.
This comment was minimized by the moderator on the site
For everyone wondering how to get the sheet index to update automatically, you need to be able to call the function and then Re-enter the formula into where you want the index to be kept.
In my case I have a dedicated Index Sheet, and after most of my functions I call 'sheetnames()' and then just Re-enter the formula in the specific cell.
This comment was minimized by the moderator on the site
sheetnames();
ss.getSheetByName('Index').getRange('A1').setFormula('=sheetnames()');
This comment was minimized by the moderator on the site
What's ss?
This comment was minimized by the moderator on the site
Hi Carlos,

var ss = SpreadsheetApp.getActive();

Hope that helps.
This comment was minimized by the moderator on the site
me pueden ayudar para crear una macro en GAS que abra una nueva hoja (sheet), luego la renombre y luego se puede escribir dentro de esta hoja nueva?
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations