Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jun 2007
    Location
    London, United Kingdom
    Posts
    9
    Thanks
    0
    Thanked 1 Time in 1 Post

    Hyperlinks (Excel 2003)

    Hi,

    I have a column of 'mailto' Hyperlinks in an excel spreadsheet. Some how the mailto address has become different to the Displayed texin the column.

    I am looking for a way to copy the two elements of the hyperlinks, ie email address and text to display, into two seperate colums so that I can easily see which ones are wrong and need editing.

    Help much appreciated.

    Derek

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

    Re: Hyperlinks (Excel 2003)

    Welcome to Woody's Lounge!

    You could copy the following custom function into a module in the Visual Basic Editor:

    Function HyperlinkPart(oCell As Range, intPart As Integer) As String
    If oCell.Hyperlinks.Count > 0 Then
    With oCell.Hyperlinks(1)
    Select Case intPart
    Case 1
    HyperlinkPart = .Address
    Case 2
    HyperlinkPart = .SubAddress
    Case 3
    HyperlinkPart = .TextToDisplay
    End Select
    End With
    End If
    End Function

    Say your e-mail hyperlinks are in column A, starting in A2.
    In B2, enter the formula =HyperlinkPart(A2,1)
    This will return mailto: followed by the e-mail address.
    In C2, enter the formula =HyperlinkPart(A2,3)
    This will return the display text.
    Select B2:C2, then fill down as far as needed.

    Note: if you store the function in your Personal.xls workbook, you must prefix the function name with Personal.xls!:

    =Personal.xls!HyperlinkPart(A2,1)

    See Legare Coleman's <!post=Personal.xls Tutorial (All),118382>Personal.xls Tutorial (All)<!/post> if you need info about Personal.xls.

  3. #3
    New Lounger
    Join Date
    Jun 2007
    Location
    London, United Kingdom
    Posts
    9
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hyperlinks (Excel 2003)

    Hans,

    Thank you very much. That does the trick exactly.

    Derek

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

    Re: Hyperlinks (Excel 2003)

    Just as a warning: you may want to remove your e-mail address from your signature, to prevent web bots from harvesting it for spam.

    (It's ok to leave your e-mail address in your personal profile - the web bots are much less likely to look at that)

Posting Permissions

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