How to List Worksheet Names in Excel?
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.
Classic Menu for Office: brings back classic menus to Office 2010 and 2013 (includes Office 365).
Office Tab: brings tabbed interface to Office as the use of web browser Chrome, Firefox and Internet Explorer.
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. Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed (or you can press the shortcut key Alt + F11 to open the window), then click Insert > Module, and input the following code into the Module:
VBA: List worksheet names in a new worksheet named “KutoolsforExcel”.
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
VBA: List worksheet names in active worksheet.
Sub ListWorkSheetNames() 'Updateby20140624 Dim xWs As Worksheet Set xWs = Application.ActiveSheet For i = 1 To Application.Sheets.Count xWs.Range("A" & i) = Application.Sheets(i).Name Next i End Sub
2. Then click button to run the code, and all of the worksheet names in active workbook have been listed.
The above two codes 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.
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.
After installing Kutools for Excel, apply Create List of Sheet Names tool according to these steps:
1. Click Enterprise > Worksheet Tools > Create List of Sheet Names, see screenshot:
2. In the Create List of Sheet Names dialog box, please specify the following settings:
Choose sheet index styles you like, you can create the worksheet names with hyperlinks or with macro buttons.
Enter the worksheet names for sheet index.
Specify the location of the worksheet index.
Specify how much columns you want to use in the new worksheet to display the worksheet names.
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|