Computing.Net > Forums > Office Software > Excel Hyperlinking Multiple Tabs

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Excel Hyperlinking Multiple Tabs

Reply to Message Icon

Name: amariano413
Date: August 20, 2008 at 10:15:24 Pacific
OS: xp
CPU/Ram: 1bg
Product: IBM
Comment:

I have a main tab with a long list of companies. I then have individual tabs for each company with in-depth data. I’m looking for a way to have a hyperlink connect each company to its individual tab however it would take a long time to individually link each cell to its corresponding tab. Is there a way to highlight the list of companies and then hyperlink them to their sequential corresponding tab? Or some other way to link them rather than doing one by one.



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: August 20, 2008 at 13:10:17 Pacific
Reply:

If the company names in the cells that contain your list match the sheet name for each company exactly, then something like the following code should work. The order of the list doesn't have to match the order of the sheets, but the names must match exactly.

(You would need to change the first line to match the range that contains your list of company names.)


Sub Hyperlinker()
For Each cName In Sheets(1).Range("A1:A4")
ActiveSheet.Hyperlinks.Add Anchor:=cName, Address:="", SubAddress:= _
cName & "!A1", TextToDisplay:=cName.Value
Next
End Sub


If the list of names is in the same order as the sheets, then this code should work. It doesn't matter if the names match or not. The main assumption is that your list starts in Sheet1!A1 and that A1 should be hyperlinked to Sheet2, A2 hyperlinked to Sheet3, etc.



Sub Hyperlinker()
ShtNum = 1
For Each cName In Sheets(1).Range("A1:A4")
ShtNum = ShtNum + 1
ActiveSheet.Hyperlinks.Add Anchor:=cName, Address:="", SubAddress:= _
Sheets(ShtNum).Name & "!A1", TextToDisplay:=cName.Value
Next
End Sub


0

Response Number 2
Name: amariano413
Date: August 20, 2008 at 13:22:37 Pacific
Reply:

That sounds like it would work perfectly since they are all in the same order and have the exact names. Can you guide on how to add the code. Im not familiar with access coding and have never done anything like this before.


0

Response Number 3
Name: DerbyDad03
Date: August 20, 2008 at 17:39:19 Pacific
Reply:

Assuming your "main tab" is Sheet1 try this:

1 - Make a back-up copy of the workbook in case it blows up.

2 - Make a back-up copy of the workbook in case it blows up. (You heard that, right? If you didn't, don't blame me.)

3 - Right click the sheet tab for Sheet1 and click on View Code.

4 - Paste this code into the window that opens:

Sub Hyperlinker()
ShtNum = 1
For Each cName In Sheets(1).Range("A1:A4")
ShtNum = ShtNum + 1
ActiveSheet.Hyperlinks.Add _
Anchor:=cName, Address:="", SubAddress:= _
Sheets(ShtNum).Name & "!A1", _
TextToDisplay:=cName.Value
Next
End Sub

5 - If any of the code turns red, it won't work, so either fix it by addig carriage retruns where you need them or post back.

6 - Change Range("A1:A4") to be the actual range of your list. They must be the same size - i.e. 25 names and 25 sheets not counting Sheet1. If you have a header row or if the list doesn't start in A1, you'll need to adjust for that.

7 - Put yoru cursor anywhere within the code and Click Run...Run Sub/Userform or hit F5.

8 - Post back whatever errors you get or problems you have, cuz I doubt it'll work right the first time.

You did make a back up copy of the workbook, didn't you?


0

Response Number 4
Name: amariano413
Date: August 21, 2008 at 06:28:34 Pacific
Reply:

that worked great, thank you so much.

oh and I did back it up. :-)


0

Response Number 5
Name: DerbyDad03
Date: August 21, 2008 at 07:41:29 Pacific
Reply:

Glad I could help.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Excel Hyperlinking Multiple Tabs

Excel, hyperlinks no longer work www.computing.net/answers/office/excel-hyperlinks-no-longer-work/7090.html

Excel Opening hyperlink in Tab (I/E 8) www.computing.net/answers/office/excel-opening-hyperlink-in-tab-ie-8/9628.html

Excel hyperlinks issue www.computing.net/answers/office/excel-hyperlinks-issue/3837.html