Microsoft Office Tutorials and References
In Depth Information
Creating a Table of Contents of a Workbook
Creating a Table of Contents of a Workbook
This macro creates an index or table of contents, with links that point to each
worksheet in the workbook.
Example file:
E020.xls
Scenario: Working with a workbook that contains many
sheets can get cumbersome. It can be difficult to find or to
activate a specific worksheet quickly.
This macro shows how to quickly create an index sheet, or
'Table of Contents', with hyperlinks that make it easier to
navigate around multiple worksheets.
Exl
Figure 25 – Table of Contents with Links
View the Appendix to learn how to store this procedure
in a Standard module.
Option Explicit¶
' * * * * *¶
Sub TableOfContents()¶
'Variable declaration¶
'Worksheet for the table of contents¶
Dim WS As Worksheet¶
'Other worksheets within the workbook¶
Dim Sht As Worksheet¶
'Worksheet that is currently active¶
Dim CurrentSht As Object¶
Dim Contents As String¶
'Change the following variables¶
Contents = "Table of contents"¶
 
Search JabSto ::




Custom Search