Reputation: 149
I have a worksheet with a hyperlink and what I want to do is to open a UserForm when I click on this hyperlink.
=HYPERLINK("frmReferral","Go for Referral")
frmReferral is the form name that I created in this excel workbook. When I clicked on "Go for Referral" link, it's return "Cannot open the specified file.". Is there anyway to do this without using VBA. If there is no option, I will try to do this with VBA.
Upvotes: 2
Views: 1944
Reputation: 2441
You can acquire this with VBA. Adjust code below to refer to your cell containing hyperlink. Make sure you enter this code in Worksheet module
of selected sheet, not regular module
.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Me.Range("A1")) Is Nothing Then
If Range("B1").Value = "YES" Then UserForm1.Show 'adjust B1 range to your cell
End If
End Sub
Upvotes: 2