24. VBA Tips - Create An Index Page
This tip shows you how to create an Index page with hyperlinks to each sheet:
Here's a screen shot of what we will produce:
Here's the code we use:
- To run this, download the example file, and press the button
- The button runs the "CreateIndex" macro
- Application.DisplayAlerts = False is a command that turns off alerts.
- The reason we have this is so that if we rerun the code and delete the existing Index Sheet, Excel doesn't popup message boxes.
- On Error Resume Next
On Error GoTo 0
- This part of the code deletes the Index sheet if it already exists
- We then add a new index sheet
- Now, we loop through each sheet, and add a hyperlink to the first cell on the sheet thus creating our index page.
Training Video on how to Create An Index Page in Excel: