国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

目錄
How to Create a Dynamic Table of Contents in Excel
首頁 系統(tǒng)教程 Windows系列 如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

Mar 24, 2025 am 08:01 AM

A table of contents is a total game-changer when working with large files – it keeps everything organized and easy to navigate. Unfortunately, unlike Word, Microsoft Excel doesn’t have a simple “Table of Contents” button that adds this handy feature and updates it automatically. No, you’ll have to roll up your sleeves and create a dynamic table of contents yourself. This table will automatically update and contain clickable links, allowing you to add and remove sheets – as well as jump between them – with ease. This guide has all the info you need to create a dynamic table of contents in Excel.

How to Create a Dynamic Table of Contents in Excel

Technically, there are three ways to create a dynamic table of contents (TOC) in Excel. However, only one of them guarantees a fully automated TOC, and that’s Visual Basic for Applications or VBA for short – Microsoft’s native programming language. The other two – traditional formulas and Power Query – will give you a semi-dynamic table of contents in Excel – one that either doesn’t include clickable links or doesn’t update automatically. Since we’re after a fully dynamic Excel table of contents, we’ll use VBA.

If you aren’t particularly VBA-savvy; don’t worry – you just need to follow a few steps. But first – let’s create our table of contents.

Step 1: Click on the “Insert Worksheet” button next to your sheets at the bottom.

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

Step 2: Name the sheet “Table of Contents.”

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

Step 3: Drag the sheet to the first position for better navigation.

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

Step 4: Enter the names of your sheets in Column A of the “Table of Contents” sheet.

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

And voilà – you’ve got your table of contents. You can play with the aesthetics of this TOC later – now, we need to make it dynamic. To do so, we’ll need the help of the VBA Editor – a built-in Excel tool that lets you write and run custom codes.

Step 1: Press “Alt + F11” to open the VBA Editor.

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

Step 2: Go to the “Insert” tab at the top.

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

Step 3: Select “Module” from the dropdown menu.

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

Step 4: Copy and paste the following VBA code:

Sub CreateTOC()

??? Dim ws As Worksheet

??? Dim toc As Worksheet

??? Dim i As Integer

??? ‘ Check if TOC sheet already exists, delete if it does

??? On Error Resume Next

??? Set toc = ThisWorkbook.Sheets(“Table of Contents”)

??? On Error GoTo 0

??? If Not toc Is Nothing Then Application.DisplayAlerts = False: toc.Delete: Application.DisplayAlerts = True

??? ‘ Create new TOC sheet

??? Set toc = ThisWorkbook.Sheets.Add(Before:=ThisWorkbook.Sheets(1))

??? toc.Name = “Table of Contents”

??? ‘ Set up TOC header

??? toc.Cells(1, 1).Value = “Table of Contents”

??? toc.Cells(1, 1).Font.Bold = True

??? toc.Cells(1, 1).Font.Size = 14

??? ‘ Loop through all sheets and add hyperlinks

??? i = 2

??? For Each ws In ThisWorkbook.Sheets

??????? If ws.Name <> “Table of Contents” Then

??????????? toc.Hyperlinks.Add Anchor:=toc.Cells(i, 1), _

??????????????? Address:=””, _

??????????????? SubAddress:=”‘” & ws.Name & “‘!A1”, _

??????????????? TextToDisplay:=ws.Name

??????????? i = i + 1

??????? End If

??? Next ws

??? ‘ Adjust column width

??? toc.Columns(“A”).AutoFit

?End Sub

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

Step 5: Hit “F5” to run the code.

Step 6: Exit the VBA Editor.

You’ll notice your Excel table of contents is now clickable.

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

To automatically update your table of contents after changes, you just need to repeat Steps 1 to 6. This will add any new sheets to the list or remove the ones you deleted.

如何在Excel中創(chuàng)建動(dòng)態(tài)目錄

以上是如何在Excel中創(chuàng)建動(dòng)態(tài)目錄的詳細(xì)內(nèi)容。更多信息請關(guān)注PHP中文網(wǎng)其他相關(guān)文章!

本站聲明
本文內(nèi)容由網(wǎng)友自發(fā)貢獻(xiàn),版權(quán)歸原作者所有,本站不承擔(dān)相應(yīng)法律責(zé)任。如您發(fā)現(xiàn)有涉嫌抄襲侵權(quán)的內(nèi)容,請聯(lián)系admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費(fèi)脫衣服圖片

Undresser.AI Undress

Undresser.AI Undress

人工智能驅(qū)動(dòng)的應(yīng)用程序,用于創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用于從照片中去除衣服的在線人工智能工具。

Clothoff.io

Clothoff.io

AI脫衣機(jī)

Video Face Swap

Video Face Swap

使用我們完全免費(fèi)的人工智能換臉工具輕松在任何視頻中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費(fèi)的代碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

功能強(qiáng)大的PHP集成開發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺化網(wǎng)頁開發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級代碼編輯軟件(SublimeText3)

熱門話題

Laravel 教程
1601
29
PHP教程
1502
276
如何在桌面圖標(biāo)上更改字體顏色(Windows 11) 如何在桌面圖標(biāo)上更改字體顏色(Windows 11) Jul 07, 2025 pm 12:07 PM

如果您在閱讀桌面圖標(biāo)的文本或只是想個(gè)性化桌面外觀時(shí)遇到麻煩,則可能正在尋找一種在Windows 11中更改桌面圖標(biāo)上字體顏色的方法。不幸的是,Windows 11不提供簡單的內(nèi)置內(nèi)置

修復(fù)Windows 11 Google Chrome無法打開 修復(fù)Windows 11 Google Chrome無法打開 Jul 08, 2025 pm 02:36 PM

修復(fù)Windows11GoogleChrome無法打開谷歌瀏覽器是目前最流行的瀏覽器,但即使是它有時(shí)也需要幫助才能在Windows上打開。然后按照屏幕上的說明完成該過程。完成上述步驟后,再次啟動(dòng)GoogleChrome,看看它現(xiàn)在是否可以正常工作。5.刪除Chrome用戶配置文件如果您仍然遇到問題,可能是時(shí)候刪除Chrome用戶個(gè)人資料了。這將刪除您的所有個(gè)人信息,因此請務(wù)必備份所有相關(guān)數(shù)據(jù)。通常,您通過瀏覽器本身刪除Chrome用戶配置文件。但是鑒于您無法打開它,這是另一種方法:打開Windo

如何修復(fù)Windows中未檢測到的第二個(gè)監(jiān)視器? 如何修復(fù)Windows中未檢測到的第二個(gè)監(jiān)視器? Jul 12, 2025 am 02:27 AM

Windows檢測不到第二個(gè)顯示器時(shí),首先要檢查物理連接是否正常,包括電源、線纜插接和接口兼容性,并嘗試更換線材或轉(zhuǎn)接頭;其次通過設(shè)備管理器更新或重裝顯卡驅(qū)動(dòng),必要時(shí)可回滾驅(qū)動(dòng)版本;接著在顯示設(shè)置中手動(dòng)點(diǎn)擊“檢測”以識別顯示器,確認(rèn)是否被系統(tǒng)正確識別;最后檢查顯示器輸入源是否切換至對應(yīng)接口,并確認(rèn)線纜接入的顯卡輸出口是否正確。按照上述步驟依次排查,通??梢越鉀Q大部分雙屏識別問題。

想建立日常工作桌面嗎?取而代之的是迷你電腦 想建立日常工作桌面嗎?取而代之的是迷你電腦 Jul 08, 2025 am 06:03 AM

迷你電腦已經(jīng)發(fā)生了

修復(fù)無法在Windows Google Chrome上傳文件 修復(fù)無法在Windows Google Chrome上傳文件 Jul 08, 2025 pm 02:33 PM

在GoogleChrome中上傳文件時(shí)遇到問題?這可能很煩人,對吧?無論您是將文檔附加到電子郵件、在社交媒體上共享圖像,還是提交工作或?qū)W校的重要文件,流暢的文件上傳過程都是至關(guān)重要的。因此,如果您的文件上傳在WindowsPC上的Chrome中持續(xù)失敗,可能會令人沮喪。如果您還沒有準(zhǔn)備好放棄您最喜歡的瀏覽器,這里有一些提示修復(fù)無法在WindowsGoogleChrome上傳文件1.從通用修復(fù)開始在我們了解任何高級故障排除技巧之前,最好先嘗試下面提到的一些基本解決方案。排除互聯(lián)網(wǎng)連接問題:互聯(lián)網(wǎng)連

如何清除Windows中的打印隊(duì)列? 如何清除Windows中的打印隊(duì)列? Jul 11, 2025 am 02:19 AM

遇到打印任務(wù)卡住問題,清空打印隊(duì)列并重啟PrintSpooler服務(wù)是有效解決方法。首先打開“設(shè)備和打印機(jī)”界面找到對應(yīng)打印機(jī),通過右鍵點(diǎn)擊任務(wù)選擇“取消”來清除單個(gè)任務(wù),或點(diǎn)擊“取消所有文檔”一次性清空隊(duì)列;若隊(duì)列無法訪問,則按下Win R輸入services.msc打開服務(wù)列表,找到“PrintSpooler”停止后再啟動(dòng)該服務(wù),必要時(shí)可手動(dòng)刪除C:\Windows\System32\spool\PRINTERS路徑下的殘留文件以徹底解決問題。

迷你PC可以替換您的桌面PC嗎? 迷你PC可以替換您的桌面PC嗎? Jul 07, 2025 pm 12:12 PM

我們通常會看到桌子

如何在Windows 11 File Explorer中顯示文件擴(kuò)展名? 如何在Windows 11 File Explorer中顯示文件擴(kuò)展名? Jul 08, 2025 am 02:40 AM

要在Windows11文件資源管理器中顯示文件擴(kuò)展名,可按以下步驟操作:1.打開任意文件夾;2.點(diǎn)擊頂部菜單欄的“查看”標(biāo)簽;3.點(diǎn)擊右上角“選項(xiàng)”按鈕;4.切換到“查看”標(biāo)簽頁;5.取消勾選“隱藏已知文件類型的擴(kuò)展名”;6.點(diǎn)擊“確定”保存設(shè)置。此設(shè)置有助于識別文件類型、提升開發(fā)效率和排查問題。若只想臨時(shí)查看擴(kuò)展名,可右鍵點(diǎn)擊文件選擇“重命名”,按Esc鍵退出即可,不會更改系統(tǒng)設(shè)置。

See all articles