Hyperlink userform

  • Thread starter Thread starter Leksie
  • Start date Start date
L

Leksie

Can anyone tell me how to include an hyperlink using a label in an userform?
Simply copying the url in the caption field of a label doesn't work!

Thanks,
Alex
 
Hi,

You can use a workaround.
Put some text in the label and format it to 'look like' a Hyperlink i.e.
blue, underlined and in an appropriate font.
Right click the label and view code and paste the code below in.

The down side is that when you hover over the link you don't get the hand
symbol but if you Google for one you should find a custom cursor and you can
then select custom-cursor(15) from the label dialogbox and your done.

Private Sub Label1_Click()
Link =
"http://www.microsoft.com/office/com...rosoft.public.excel.programming&lang=en&cr=US"
On Error GoTo TheEnd
ActiveWorkbook.FollowHyperlink Address:=Link, NewWindow:=True
Unload Me
Exit Sub
TheEnd:
MsgBox "Cannot open Hyperlink"
End Sub

Mike
 
Thanks a lot Mike!

Mike H said:
Hi,

You can use a workaround.
Put some text in the label and format it to 'look like' a Hyperlink i.e.
blue, underlined and in an appropriate font.
Right click the label and view code and paste the code below in.

The down side is that when you hover over the link you don't get the hand
symbol but if you Google for one you should find a custom cursor and you can
then select custom-cursor(15) from the label dialogbox and your done.

Private Sub Label1_Click()
Link =
"http://www.microsoft.com/office/com...rosoft.public.excel.programming&lang=en&cr=US"
On Error GoTo TheEnd
ActiveWorkbook.FollowHyperlink Address:=Link, NewWindow:=True
Unload Me
Exit Sub
TheEnd:
MsgBox "Cannot open Hyperlink"
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top