Home > Software Tutorial > Office Software > How to Add a Table of Contents to Excel (And Why You Should)

How to Add a Table of Contents to Excel (And Why You Should)

Linda Hamilton
Release: 2025-02-06 18:50:11
Original
900 people have browsed it

Efficiently manage Excel workbooks: Various ways to create directories

Excel workbook with hundreds of worksheets? Creating a directory makes it easy to find specific worksheets. Although Excel does not have one-click directory creation function, the following methods can help you achieve it!

Why do you need to add a directory in Excel?

If your Excel workbook contains hundreds of worksheets and needs to find specific worksheets to update or modify data, manual search can be very time-consuming. And the directory allows you to easily navigate your workbook and quickly find the tables you want.

As a SEO content writer, I often process large Excel files with keyword data. Using the directory, I can easily jump to Excel worksheets that store the information I need, saving a lot of time and effort and avoid scrolling through countless worksheets and tabs.

Catalogs help maintain structured layouts, logically organize relevant worksheets and sections, thereby improving the overall user experience. It also makes it easier for team members to find specific sections for input and review, and minimizes errors by reducing the possibility of unexpectedly modifying irrelevant data.

The following demonstration uses Microsoft Excel 365. My workbook already contains four worksheets: Team A, Team B, Team C, and Team D.

Add Excel directory manually

To create a directory manually, first determine where to place it. It is recommended to create a new worksheet as a directory for easy search and management.

Create a new worksheet: Right-click any existing worksheet name, then click Insert, and select Worksheet. Alternatively, you can press Shift Alt F1.

How to Add a Table of Contents to Excel (And Why You Should)

Next, select the cell you want to add a hyperlink, such as B5 (or any cell you like).

After selecting the cell, go to the Insert tab, click the Link drop-down item, and select the Insert Link option to display the Insert Hyperlink dialog box. You can also access it using the Ctrl K shortcut key.

How to Add a Table of Contents to Excel (And Why You Should)

Navigate to the "Place in this document" section, select your preferred sheet, and type the text you want to display as a hyperlink. When finished, press OK to insert the link.

How to Add a Table of Contents to Excel (And Why You Should)

Repeat this process for other worksheets.

That's it! Now that you have a clickable link, you will be taken directly to the corresponding worksheet when clicked.

How to Add a Table of Contents to Excel (And Why You Should)

Use hyperlink functions/formula

Another way to manually add directories in Excel is to use the hyperlink function. In this method, you need to type the names of all the sheets and add a hyperlink formula for each sheet separately.

First, select the cell to display the directory and enter the following formula:

<code>=HYPERLINK("#'WorkSheetName'!A1", "FriendlyName")</code>
Copy after login
Copy after login

Where, "WorkSheetName" is the worksheet name for which you want to create a link. The “#” symbol identifies the worksheet and the “!” represents the cell position on the target worksheet. The "FriendlyName" variable indicates the name to be displayed in the directory.

How to Add a Table of Contents to Excel (And Why You Should)

Repeat this process for other worksheets using the same formula.

Automatically generate directory

You can use Excel's Power Query tool to automatically create directories. With this tool, you can list hundreds of worksheets on a specific worksheet with just a few clicks and create hyperlinks that will take you directly to each corresponding worksheet when clicked.

For a smooth connection to Power Query, it is recommended that you pause synchronization with OneDrive of your workbook. You should also make sure that you save the workbook and temporarily disable sharing.

First, go to the Data tab in Excel. Click Get Data, then select From File, and then click the From Excel Workbook option.

How to Add a Table of Contents to Excel (And Why You Should)

A dialog box will appear where you can select the workbook you are currently using. After selecting, click Import.

How to Add a Table of Contents to Excel (And Why You Should)

Do not select a specific table or worksheet from the list that appears, but choose the name of the workbook itself. Then, click Convert Data.

How to Add a Table of Contents to Excel (And Why You Should)

You will now see a list of all the sheets, tables, and defined names in the workbook. Since we only need the worksheet name, the Apply Filter only displays the worksheets in the Type option.

How to Add a Table of Contents to Excel (And Why You Should)

Next, right-click the Name column (including the sheet name) and select Delete Other Columns. This step leaves only one column that lists all sheet names.

How to Add a Table of Contents to Excel (And Why You Should)

You can also rename the title to whatever name you like. After making these changes, click the Close and Load to option.

How to Add a Table of Contents to Excel (And Why You Should)

Select "Existing Worksheet" and enter the cell to start the list (for example, cell A1 or B5).

How to Add a Table of Contents to Excel (And Why You Should)

You will now have a collection of all the sheet names in the workbook.

The last step is to create a hyperlink for the worksheet name using the hyperlink formula. When you create a hyperlink for the first worksheet and press Enter, all worksheet columns will automatically update their hyperlinks. If not, you can simply drag the fill handle to apply the formula to all rows in the directory.

You can create a hyperlink using the following formula:

<code>=HYPERLINK("#'WorkSheetName'!A1", "FriendlyName")</code>
Copy after login
Copy after login

How to Add a Table of Contents to Excel (And Why You Should)

Now if you click any hyperlink, it will take you directly to the corresponding worksheet in the workbook.

Automatically refresh the worksheet

One of the great benefits of using Power Query is that you can easily update directories and add or delete worksheets in your workbooks whenever you add or delete workbooks.

For example, I have added a new worksheet to the workbook and saved it as the name of "Team E". Now I want this worksheet and its hyperlink to appear in the directory.

To update the outline, simply return to the main worksheet and double-click the "Catalog" Excel query that appears to the right of the workbook.

How to Add a Table of Contents to Excel (And Why You Should)

In the menu that opens, click Refresh Preview to update the directory.

How to Add a Table of Contents to Excel (And Why You Should)

However, when you update it, any recently added table or defined name will also be included in the updated directory. To filter it, navigate to the Filtered Rows option, click the Type drop-down menu, and select only Worksheets.

How to Add a Table of Contents to Excel (And Why You Should)

That's it! Power Query will automatically update the directory and include newly added worksheets.

How to Add a Table of Contents to Excel (And Why You Should)

Using VBA code scripts

If your workbook is large, you can also use VBA macros to automate this process by traversing all the sheets, creating list items for each sheet, and inserting a hyperlink. (The VBA code part is omitted, because the code provided in the original text needs to be run separately and cannot be rendered directly here.)

Create a link to return to the directory table

If your workbook has many sheets, it can be helpful to add a hyperlink to each worksheet that returns to the home directory page.

First, open the worksheet to which you want to add a return link, and then select the cell where you want to display the link. Next, go to "Insert" > "Link" > "Place in this document". Select the main worksheet and type "Catalog Page" as the display text.

How to Add a Table of Contents to Excel (And Why You Should)

You have now created a link that will be returned to your home directory page when clicked. You can easily copy this link and paste it on all other worksheets.

Whether you are dealing with a small number of worksheets or large workbooks, these methods can help you create directories efficiently.

The above is the detailed content of How to Add a Table of Contents to Excel (And Why You Should). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template