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 create and list all worksheet names from a workbook?

We may need to get a list of worksheet names in a workbook. For example, we might want to create an index of worksheet names in workbook. To make such a list is not simple, this tutorial is giving instructions on how to list worksheet names in Excel.

Create and list all worksheet names with VBA code

Create and list all worksheet names and link to each sheet with Kutools for Excel

Create and list all worksheet names vertically on the left side with Kutools for Excel


List all worksheet names and link to each sheet:

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 as you need.

    worksheet names with hyperlinks   worksheet names with macro buttons
doc-list-worksheet-names2  2 doc-list-worksheet-names2  2 doc-list-worksheet-names2

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!


arrow blue right bubble Create and list all worksheet names with VBA code


The following two VBA codes can help you list all of the worksheet names in a new worksheet or the active worksheet. Please do as this:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA: List all worksheet names in a new worksheet:

Sub ListWorkSheetNamesNewWs()
'Updateby20140624
Dim xWs As Worksheet
On Error Resume Next
Application.DisplayAlerts = False
xTitleId = "KutoolsforExcel"
Application.Sheets(xTitleId).Delete
Application.Sheets.Add Application.Sheets(1)
Set xWs = Application.ActiveSheet
xWs.Name = xTitleId
For i = 2 To Application.Sheets.Count
    xWs.Range("A" & (i - 1)) = Application.Sheets(i).Name
Next
Application.DisplayAlerts = True
End Sub

2. Then click doc-merge-multiple-workbooks-button button to run the code, and all of the worksheet names in active workbook have been listed into a new worksheet called KutoolsforExcel, see screenshot:

doc-list-worksheet-names1

The above code only support to create a list of all worksheet names in the workbook, but if you want to add links to the worksheet names, how could you do? The following method may help you.


arrow blue right bubble Create and list all worksheet names and link to each sheet with Kutools for Excel

With the Create List of Sheet Names utility of the third party add-in Kutools for Excel, you are able to create a list of worksheet names in one click, and link to each worksheet with hyperlink.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days

After installing Kutools for Excel, please do as follows:

1. Click Enterprise > Worksheet > Create List of Sheet Names, see screenshot:

doc-list-worksheet-names1

2. In the Create List of Sheet Names dialog box, please specify the following settings:

doc-list-worksheet-names2

(1.) Choose sheet index styles you like, you can create the worksheet names with hyperlinks or with macro buttons.

(2.) Enter the worksheet names for sheet index.

(3.) Specify the location of the worksheet index.

(4.) Specify how much columns you want to use in the new worksheet to display the worksheet names.

Click to Download and free trial Kutools for Excel Now!

3. After finishing the settings, then click OK. All of the worksheet names have been listed with links in a new worksheet of the current workbook. See screenshot:

worksheet names with hyperlinks worksheet names with macro buttons
doc-list-worksheet-names3 doc-list-worksheet-names4

Click to know more about this feature.

Click to Download and free trial Kutools for Excel Now!


arrow blue right bubble Create and list all worksheet names vertically on the left side with Kutools for Excel

Kutools for Excel’s Navigation Pane also can help you list all opened workbooks and worksheets vertically on the left side of the workbook. Please do as follows:

Click Kutools > Navigation > Workbook & Sheet icon, and all opened workbooks and worksheets are listed as follows:

(1.) All the opened workbooks are listed into the top list box, you can click one to locate the workbook;

(2.) All the worksheets with the selected workbook are listed below, please click one to go to the sheet.

doc-list-worksheet-names4

Click to Download and free trial Kutools for Excel Now!


arrow blue right bubble Demo: List all worksheet names with Kutools for Excel

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!


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, 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!
officetab bottom
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.
    Joseph Kozsuch · 1 years ago
    Thanks so much, this worked great.
  • To post as a guest, your comment is unpublished.
    Jenson · 1 years ago
    Works great!! Thank you!!!!
  • To post as a guest, your comment is unpublished.
    Edgar · 1 years ago
    sooooo helpful, works as expected!!!!! Thanks
  • To post as a guest, your comment is unpublished.
    Huntreth · 2 years ago
    THANK YOU SO MUCH! I freaking love your website. In a matter of minutes I've had a ton of time saved with two sections of this site including this one. Love it!
  • To post as a guest, your comment is unpublished.
    Jana Mentz · 2 years ago
    Hi
    I would like to know how to list the tab color next to the tab name in this macro?
    E.g. in the KutoolsforExcel sheet list:
    Column A Column B
    TabName1 Yellow
  • To post as a guest, your comment is unpublished.
    Engr Awlad · 2 years ago
    VBA code works nice to save times ever , Thanks tooooooooooooooooooooooooooooooo much
  • To post as a guest, your comment is unpublished.
    perry landau · 5 years ago
    it's great worked like charm
  • To post as a guest, your comment is unpublished.
    perry landau · 5 years ago
    the best it worked like charm
  • To post as a guest, your comment is unpublished.
    Tinman · 5 years ago
    The 'Range' step in your ListWorkSheetNames macro generates runtime error 1004: method range of object global failed. I have it saved in a PERSONAL.XLSB module, running from a macro-enabled spreadsheet in Office10. What am I missing?

    Sub ListWorkSheetNames()
    For i = 1 To Sheets.Count
    Range(”A” & i) = Sheets(i).Name
    Next i
    End Sub
  • To post as a guest, your comment is unpublished.
    Ian Alp · 5 years ago
    How to list the Sheetname of a sub WB and list them in the Main WB?
  • To post as a guest, your comment is unpublished.
    SamJ · 6 years ago
    Great - but how do I do this in Visio ie for an index of worksheets in visio?