'Fixing' an Index Sheet

stuartgb100

Active Member
Joined
May 10, 2015
Messages
287
Office Version
  1. 2021
Platform
  1. Windows
I have a workbook containing a large number of sheets.
To more easily navigate through the book, I have an Index sheet containing hyperlinks to all the various sheet names.
This lets me 'jump' to the required sheet, and works well.
However, after 'jumping', the index sheet is no longer in view (is that in the taskbar - not familiar with the terminology !)
So I have to go back to the beginning to show all sheet names, before I can see 'Index' and click on it for the next required sheet.

Is there a way to 'fix' this so that the sheet 'Index' tab is always visible ?
Thanks.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Can you explain what is happening please ?
When you are adding the hyperlink you are not referencing the Anchor to the Index sheet so the Anchor was going on the active sheet.
I have not fully tested the code but try making this change

Rich (BB code):
Sheets("Index").Hyperlinks.Add Anchor:=Sheets("Index").Range("A" & i), Address:="", _
                SubAddress:="'" & ws.Name & "'!A1", TextToDisplay:=ws.Name
 
Upvote 0
Thanks again, that seems to be working.
I'll continue to 'test'.
I thought that it was 'losing' the Index sheet, but what threw me was that when I used 'Test' (as mentioned above) it ran on the active Vis sheet AND the Index sheet.

Thanks again,
Cheers.
 
Upvote 0
it ran on the active Vis sheet AND the Index sheet.
Only "sort of" I believe. I think that if you remove the extra code we just added and went through the process again of closing when say "Today" (let's use your actual sheets names as examples since they are listed in the code) was the active sheet you would find that whilst both 'Today' and 'Index' appear to have the hyperlinks, I don't think any of those hyperlinks would actually work.

In relation to the cells in column A of Index, they appear to be hyperlinks because your Workbook_Open code uses this line
VBA Code:
Worksheets("Index").Columns(1).ClearContents
That clears the text from the cells but not the (blue/underline) formatting. I would recommend using this line instead.
VBA Code:
Worksheets("Index").Columns(1).Clear
 
Upvote 0
I understand thanks, and will change the code accordingly.

I tested with the 'old' code after I had posted, and I found the same.
Your explanation clears things up.

Thanks for being patient.
Cheers.
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top