PDA

View Full Version : Hyperlinks within a userform



DaveBSC
03-23-2007, 09:39 AM
Hi All,
I would like to have a hyperlink within a userform that will take the user to a specific site (let's say the google homepage). I have tried two approaches:

1) I add a label to the userform and then set its caption as follows:

myForm.myLabel.Caption = "=hyperlink(""" & "<the URL>" & """,""" & "Google" & """)"

However, the result is that the text =hyperlink(""" & "<the URL>" & """,""" & "Google" & """) is displayed (not too surprisingly)

2) I add a text box to the userform and then set its value as follows:

myForm.myTextBox.Value = "=hyperlink(""" & "<the URL>" & """,""" & "Google" & """)"
Again, I get only the text.

I did a sanity check with the following code:

Cells(1, 1) = "=hyperlink(""" & "<the URL>" & """,""" & "Google" & """)"
...and I get my clickable link.

How can I put a working link in a userform? I have searched the KB without success, but maybe I missed something.
Thanks!
Dave

lucas
03-23-2007, 09:54 AM
Hi Dave,
attached is a file from a John Walkenbach post that shows the only way I know to do this....the url does show but it looks like a hyperlink because of the formatting properties of the label....hope this helps.