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
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