Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2001
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change Text to Hyperlink (Excel 2002 (XP))

    I am looking for the easiest way to turn text in excel into a hyperlink.
    1. Change list of e-mail addresses into hyperlinks
    2. Change list of URLs into hyperlinks.

    I think this could be done fairly easily by bringing the data into an Access table and then changing the table definition to make the field type a hyperlink, but it seems that there should be an easy way to do this right in Excel.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Text to Hyperlink (Excel 2002 (XP))

    The following macro will change all cells in the selection to e-mail links or hyperlinks.

    Sub MakeLinks()
    Dim oCell As Range
    For Each oCell In Selection.Cells
    If InStr(oCell.Value, "@") Then
    ActiveSheet.Hyperlinks.Add oCell, "mailto:" & oCell.Value
    Else
    ActiveSheet.Hyperlinks.Add oCell, "http://" & oCell.Value
    End If
    Next oCell
    End Sub

  3. #3
    New Lounger
    Join Date
    May 2001
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Text to Hyperlink (Excel 2002 (XP))

    Thanks Hans. Perfect and elegant as usual.

    I did find that the following formula works for the e-mail example:
    =HYPERLINK("mailto:"&O8,O8)

    However, you end up stuck with two columns of data; the e-mail addresses and the hyperlinks. I couldn't figure out a way to eliminate the formulas and just have the hyperlinked text.

    Thanks again.

Posting Permissions

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