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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,945
Office Version
  1. 365
Platform
  1. Windows
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,195,597
Messages
6,010,641
Members
441,558
Latest member
lambierules

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
Top