squirrellydw
Board Regular
- Joined
- Apr 2, 2015
- Messages
- 65
This was working fine for years but now it gives an error, any idea what is causing it? I think it has something to do with the Address but not sure. Error code is "Run-time error 1004 Application-defined or object-defined error"
VBA Code:
Private Sub Worksheet_Activate()
Dim wks As Worksheet
Dim iRow As Long
With Me.Range("A1")
.EntireColumn.ClearContents
.Value = "Index"
.Name = "Index"
End With
iRow = 1
For Each wks In Me.Parent.Worksheets
If Not wks Is Me And wks.Visible = xlSheetVisible Then
iRow = iRow + 1
With wks
.Range("A1").Name = "Start_" & .Index
.Hyperlinks.Add Anchor:=.Range("A1"), _
Address:="", _
SubAddress:="Index", _
TextToDisplay:="Back to Employee List"
End With
Me.Hyperlinks.Add Anchor:=Me.Cells(iRow, 1), _
Address:="", _
SubAddress:="Start_" & wks.Index, _
TextToDisplay:=wks.Name
End If
Next wks
End Sub