jimmisavage
Board Regular
- Joined
- Jun 28, 2017
- Messages
- 130
So I have this code which works great for unhiding a sheet when i click on a hyperlkink.
The problem is, when i click on an external link (i have some links that take me to sheets within the workbook an other links that take me to external folders) it will throw out an error when the external folder/file is closed. Does anyone know a workaround for this?
The problem is, when i click on an external link (i have some links that take me to sheets within the workbook an other links that take me to external folders) it will throw out an error when the external folder/file is closed. Does anyone know a workaround for this?
Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) Dim Ws As Worksheet
Set Ws = Evaluate(Target.SubAddress).Worksheet
With Ws
If Not .Visible Then
.Visible = xlSheetVisible
.Activate
.Range(Target.SubAddress).Select
End If
End With
End Sub