+ Reply to Thread
Results 1 to 8 of 8

Make email address a hyperlink

Hybrid View

lvalesko Make email address a hyperlink 01-18-2011, 09:33 PM
Ron Coderre Re: Make email address a... 01-18-2011, 10:33 PM
lvalesko Re: Make email address a... 01-19-2011, 12:25 PM
fliexcelhelp Re: Make email address a... 11-29-2012, 04:33 PM
ranjangupta Re: Make email address a... 01-28-2014, 10:26 PM
Naved90 Re: Make email address a... 02-09-2014, 08:56 PM
sswoll Re: Make email address a... 08-12-2015, 11:33 PM
FDibbins Re: Make email address a... 08-13-2015, 02:22 AM
  1. #1
    Registered User
    Join Date
    01-18-2011
    Location
    SoCal
    MS-Off Ver
    Excel 2003
    Posts
    2

    Make email address a hyperlink

    I currently have an Excel 2003 doc with a column of email address.

    The problem is that the email addresses are just plain text. I would like to be able to just click on an email address and have it open a blank email with the address I just clicked on as the recipient.

    Is there a way I can select this column of email addresses that are plain text and change them into hyperlinks?

    Thanks :-)

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Make email address a hyperlink

    I'm pretty sure this VBA code will work in Excel 2003:

    • Select the workbook you want to contain the macro
    • ALT+F11...to open the VBA editor
    • Insert.Module...to create a new module
    • Copy the below VBA code and paste it into that module

    Sub ConvertTxt2EmailLink()
    Dim cCell As Range
    Dim intResponse As Integer
    Dim strURL As String
    Dim strLinkText As String
    Dim strPrefix As String
    
    intResponse = MsgBox( _
          Title:="mailto Option", _
          Prompt:="OK that each link begins with 'mailto:'" & vbCr _
                   & "Click: YES ...to prepend mailto:, if missing" & vbCr _
                   & "Click: NO  ...to evaluate each link 'as is'", _
          Buttons:=vbYesNoCancel + vbQuestion)
    
    Select Case intResponse
       Case Is = vbYes
          strPrefix = "mailto:"
       Case Is = vbNo
          strPrefix = ""
       Case Is = vbCancel
          Exit Sub
    End Select
    
    For Each cCell In selection.Cells
       If cCell.Hyperlinks.Count = 0 Then
          With cCell
             If .Value <> "" Then
                strLinkText = .Value
                strURL = strPrefix & Replace( _
                         Expression:=.Value, _
                         Find:=strPrefix, _
                         Replace:="")
                
                On Error Resume Next
                ActiveSheet.Hyperlinks.Add _
                   Anchor:=cCell, _
                   Address:=strURL, _
                   TextToDisplay:=strLinkText
             End If
          End With
       End If
    Next cCell
    End Sub
    • Select your list of emails to be converted to email-links
    • ALT+F8...to see the list of available macros
    • Select: ConvertTxt2EmailLink
    • Click: Run...and follow the instructions.

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    01-18-2011
    Location
    SoCal
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Make email address a hyperlink

    WOW - that may be over my head but I'll certainly give it a try. :-)

    Thanks!

  4. #4
    Registered User
    Join Date
    11-29-2012
    Location
    ny
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Make email address a hyperlink

    It did work without any issues.
    Thank you very much!!!!!

  5. #5
    Registered User
    Join Date
    01-28-2014
    Location
    australia
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: Make email address a hyperlink

    works well.
    Thanks

  6. #6
    Registered User
    Join Date
    02-09-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Make email address a hyperlink

    thanks for the Info It really helped me

  7. #7
    Registered User
    Join Date
    08-12-2015
    Location
    Osaka, Japan
    MS-Off Ver
    MS Office 2011 for Mac
    Posts
    1

    Re: Make email address a hyperlink

    I just tried this on Office for Mac 2011 and I get "Compile error Invalid outside procedure". The Title:='mailto Option" line is highlighted. Can you tell me what the problem may be?

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Make email address a hyperlink

    sswoll welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1