How Can we get The Text of a HyperLink ??

ban
05-26-2008, 04:15 AM
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

Cas
05-26-2008, 07:10 AM
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.

ban
05-26-2008, 09:16 PM
I am using standard (insert hyperlink) method to have a hyperlink in my page

Cas
05-26-2008, 09:30 PM
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.

ban
05-26-2008, 11:57 PM
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

ban
05-27-2008, 01:20 AM
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

ban
05-27-2008, 01:36 AM
My Issue has been Solved

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum