Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to get list of sheets names in Google sheets?

This article, I will introduce some methods to get the name of current sheet name or a list of sheet names in Google sheets.

Get the current sheet name in Goolge sheets with script

Get a list of sheet names in Google sheets with script


List all sheet names and navigate between them by using hyperlinks or buttons in Excel workbook:

With Kutools for Excel's Create List of Sheet Names utility, you can quickly list all worksheet names in a new sheet with hyperlinks or macro buttons, then you can navigate between them to your need.

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Get the current sheet name in Goolge sheets with script

To get the current sheet name in Google sheets, the following simple script can help you without entering the name manually, please do as this:

1. Click Tools > Script editor, see screenshot:

doc get sheet name 1

2. In the opened project window, copy and paste the below script code into the blank Code window, see screenshot:

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

doc get sheet name 2

3. Then save the code window, and go back to the sheet that you want to get its name, then enter this formula: =sheetname() in a cell, and press Enter key, the sheet name will be displayed at once, see screenshot:

doc get sheet name 3


Get a list of sheet names in Google sheets with script

If you want to get all sheet names in the Google sheets, here is another script can do you a favor, please do as this:

1. Click Tools > Script editor to go the project window, and then copy and paste the below script code into the blank Code window, see screenshot:

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 sheet name 4

2. Then save the code window, and go back to the sheet that you want to get all sheet names, then enter this formula: =sheetnames() in a cell, and press Enter key, all sheet names in the Google sheets will be listed as following screenshot shown:

doc get sheet name 5



Recommended Productivity Tools for Excel

Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

  • More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

  • Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    guillermo · 22 days ago
    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?
  • To post as a guest, your comment is unpublished.
    Simon · 5 months ago
    Hi, thanks for the post, it works great. I am now wondering how I can make it update the sheet automatically? Thanks