Hyperlink back to Summary Page (Summary Sheet is Sheet 3)

ronanbaker1

Board Regular
Joined
Nov 15, 2012
Messages
76
Hi Guys,

I have a Summary Sheet or a Table of Contents as you will Macro that Hyperlinks all my data on that sheet to sheets 4,5,6,7,8 etc could be upto 50 with all different names. Now I want to hyperlink them back to the Summary sheet. I have nearly got what I want the only problem I have is On the last sheet I get a De-bug. As my macro is looking for another sheet. Heres what I coded so far.

Sheets("Summary").Select
For Each ws In ActiveWorkbook.Sheets

ActiveSheet.Next.Select
Range("D1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Summary!A1", TextToDisplay:="Summary"

Next
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Give this a try:
Code:
Sub Test()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Sheets
    If ws.Name <> "Summary" Then
        ws.Hyperlinks.Add Anchor:=ws.Range("D1"), Address:="", SubAddress:= _
        "Summary!A1", TextToDisplay:="Summary"
    End If
Next ws
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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