Consulting

Results 1 to 2 of 2

Thread: Hyperlinks within a userform

  1. #1
    VBAX Newbie
    Joined
    Mar 2007
    Posts
    2
    Location

    Hyperlinks within a userform

    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:

    [vba]myForm.myLabel.Caption = "=hyperlink(""" & "<the URL>" & """,""" & "Google" & """)"
    [/vba]
    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:

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

    I did a sanity check with the following code:

    [vba]Cells(1, 1) = "=hyperlink(""" & "<the URL>" & """,""" & "Google" & """)"
    [/vba] ...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

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    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.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •