Hi
I have 4 Hyperlinks(insert ,update,delete) in my Excel Sheet . I will goto the same page on clicking of those four Hyperlinks. But I want to hide some buttons there in the next page depending on the hyperlink. To Do this I want to get which Hyperlink was clicked. Can we get the Hyperlink text to the next page??????? please Help me...........Thanks in Advance
Are you using a standard (insert->hyperlink) or custom (=hyperlink worksheet function) hyperlink? It can be done either way, but it's a bit trickier with custom links.
I am using standard (insert hyperlink) method to have a hyperlink in my page
Okay, then it's straightforward - you can just use the Worksheet_FollowHyperlink event. The parameter is a hyperlink object, the .TextToDisplay property gives you the text, all you need to do is make that available to the other worksheet.
I used Worksheet_FollowHyperlink event. But it is being called after activating the next Sheet. So After activating the next Sheet , Worksheet_FollowHyperlink is being called .So the result we are seeing now is the response for the previous click of Hyperlink.......
The Code i used in the first Sheet in which i have hyperlinks is :
Public Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
MsgBox (Target.Name)
If Target.Name = "Update a Resource" Then
check = True
ElseIf Target.Name = "Delete a Resource" Then
check = False
End If
End Sub
And in Second Sheet to which i want to go after clicking the hyper link....
Private Sub Worksheet_Activate()
If check = True Then
CommandButton2.Visible = False
CommandButton1.Visible = True
Else
CommandButton2.Visible = True
CommandButton1.Visible = False
End If
End Sub
I used Worksheet_FollowHyperlink event. But it is being called after activating the next Sheet. So After activating the next Sheet , Worksheet_FollowHyperlink is being called .So the result we are seeing now is the response for the previous click of Hyperlink.......
The Code i used in the first Sheet in which i have hyperlinks is :
Public Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
MsgBox (Target.Name)
If Target.Name = "Update a Resource" Then
check = True
ElseIf Target.Name = "Delete a Resource" Then
check = False
End If
End Sub
And in Second Sheet to which i want to go after clicking the hyper link....
Private Sub Worksheet_Activate()
If check = True Then
CommandButton2.Visible = False
CommandButton1.Visible = True
Else
CommandButton2.Visible = True
CommandButton1.Visible = False
End If
End Sub
Any one please help me