Excel 2016 Random Hyperlink Formatting

ohnow

New Member
Joined
Apr 27, 2017
Messages
39
Hello,
I inherited a file I believe created in Excel 2010. I'm using 2016 now. It has a macro to create an Index sheet listing all worksheets and a hyperlink to each sheet. The macro also creates a hyperlink in A1 of each sheet to take the user to the Index sheet. I've used this macro several times before. I'm now seeing cells formatted as hyperlinks in what appears to be random behavior. The file has crashed a lot and this may have started after the last crash. The macro takes 30-90 minutes to run. I'm removing the hyperlinks as I find them but some have come back and I have not ran the macro. Any thoughts on what is causing this, how to remove all hyperlinks except on the Index sheet and each worksheet's A1?

Here is the worksheet macro:

Private Sub Worksheet_Activate()


Dim wSheet As Worksheet
Dim M As Long
M = 1
With Me
.Columns(1).ClearContents
.Cells(1, 1) = "INDEX and WORKSHEETS"
.Cells(1, 1).Name = "INDEX"
End With

For Each wSheet In Worksheets
If wSheet.Name <> Me.Name Then
M = M + 1
With wSheet
.Range("A1").Name = "Start" & wSheet.Index
.Hyperlinks.Add Anchor:=.Range("A1"), Address:="", SubAddress:="Index", TextToDisplay:="Index"
End With
Me.Hyperlinks.Add Anchor:=Me.Cells(M, 1), Address:="", SubAddress:="Start" & wSheet.Index, TextToDisplay:=wSheet.Name
End If
Next wSheet
End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

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