Hi Everyone,
I'm after a little help if possible.
I have a programme that basically controls the issuing of documentation on a site, because there can be anything from 1 to 70 tabs visible depending on their selections of requirements as they work their way through it.
Due to the large no of tabs, I had a hyperlinked index sheet which you could select the name of the sheet in column K and it would hyperlink you to cell A1 on that particular tab.
This has always worked up until the latest updates released from Microsoft.
When I use the programme in 2013 excel it works fine, so at present we have had to revert our machines back to 2013 excel to get us by.
However I do like some of the things available in 2016 excel, it also made some of our other programmes run a little quicker, so ideally id like to still use it.
Below is the code I use, maybe they have changed some of the words used within excel?
Apologies I'm pretty new to coding and I took bits of the code from something I found on the web.
Any help really appreciated!
Private Sub Worksheet_Activate()
Application.EnableCancelKey = xlDisabled
Dim wSheet As Worksheet
Dim n As Integer
Dim calcState As Long, scrUpdateState As Long
On Error GoTo Woops
calcState = Application.Calculation
Application.Calculation = xlCalculationManual
scrUpdateState = Application.ScreenUpdating
Application.ScreenUpdating = False
Columns("k:k").ClearContents
n = 1
With Me
.Columns(5).ClearContents
.Cells(1, 5) = "Hyperlinked Index"
.Cells(1, 5).Name = "Index"
End With
For Each wSheet In Worksheets
If wSheet.Name <> Me.Name And wSheet.Visible = xlSheetVisible Then
n = n + 1
With wSheet
.Range("A1").Name = "Start_" & wSheet.Index
.Hyperlinks.Add anchor:=.Range("A1"), Address:="", _
SubAddress:="Index", TextToDisplay:="Back to Index"
End With
Me.Hyperlinks.Add anchor:=Me.Cells(n, 5), Address:="", _
SubAddress:="Start_" & wSheet.Index, TextToDisplay:=wSheet.Name
End If
Next wSheet
Application.Calculation = calcState
Application.ScreenUpdating = scrUpdateState
ActiveSheet.Unprotect Password:="changed"
Columns("E:E").Select
Selection.Copy
ActiveSheet.Unprotect Password:="changed"
Columns("K:K").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Unprotect Password:="changed"
Columns("K:K").Select
Selection.ColumnWidth = 45
Columns("E:E").Select
ActiveSheet.Protect Password:="changed"
woops:
Resume Next
End Sub
Bookmarks