Skip to main content

How to convert multiple email addresses to hyperlinks in Excel? 

Author: Xiaoyang Last Modified: 2021-01-08

If you have a list of plain text email addresses in a worksheet, and now, you want to convert theses email addresses to hyperlinks that you can send emails while clicking the addresses. Of course, you can convert them to hyperlinked email addresses, but, this method will be boring if there are multiple addresses needed to be converted. In this article, I will talk about some good tricks to deal with this task.

Convert multiple email addresses to hyperlinks with Formula

Convert multiple email addresses to hyperlinks with VBA code


arrow blue right bubble Convert multiple email addresses to hyperlinks with Formula

With the Hyperlink function, you can quickly convert the column email addresses to hyperlinked addresses at once.

1. Enter this formula =hyperlink("mailto:"&A2) into a blank cell where you want to put the result, see screenshot:

doc convert addresses to hyperlinks 1

2. Then drag the fill handle down to the cells that you want to contain this formula, and all the email addresses have become clickable hyperlinks as following screenshot shown:

doc convert addresses to hyperlinks 2


arrow blue right bubble Convert multiple email addresses to hyperlinks with VBA code

As you can see, by using the above formula, a string “mailto:” will be added in front of each email addresses, if you don't want the mailto: within the addresses, the following VBA code may do you a favor.

1. Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following macro in the Module Window.

VBA code: Convert multiple email addresses to hyperlinks

Sub EmailHylink()
'updateby Extendoffice
    Dim xRg As Range
    Dim xCell As Range
    Dim xAddress As String
    Dim xUpdate As Boolean
    On Error Resume Next
    xAddress = Application.ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select the data range", "Kutools for Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    xUpdate = Application.ScreenUpdating
    Application.ScreenUpdating = False
    For Each xCell In xRg
        xCell.Hyperlinks.Add Anchor:=xCell, Address:="mailto:" & xCell.Value
    Next
    Application.ScreenUpdating = xUpdate
End Sub

3. After pasting the code, please press F5 key to this code, and a prompt box will pop out to remind you select the data range that you want to use, see screenshot:

doc convert addresses to hyperlinks 3

4. And then click OK, all the selected email addresses have been converted to the hyperlinked addresses, see screenshot:

doc convert addresses to hyperlinks 4

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Ich suche eine Formel mit der ich EMail-Adressen in URLs umwandeln kann...

Beispiel: > http://www.test.de

Kann mir jemand helfen?
This comment was minimized by the moderator on the site
Hello, kk.operator

To solve your problem, please apply the following code:

Sub EmailHylink()
'updateby Extendoffice
    Dim xRg As Range
    Dim yRg As Range
    Dim xCell As Range
    Dim xCell2 As Range
    Dim xAddress As String
    Dim xUpdate As Boolean
    Dim xRegEx As Object
    Dim arrSplit() As String
    
    On Error Resume Next
    xAddress = Application.ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select the data range", "Kutools for Excel", xAddress, , , , , 8)
    Set yRg = Application.InputBox("Please select the save range", "Kutools for Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    If yRg Is Nothing Then Exit Sub
    Set yRg = yRg.Range("A1").Resize(xRg.Rows.Count, xRg.Columns.Count)

    xUpdate = Application.ScreenUpdating
    Application.ScreenUpdating = False
    
    Set xRegEx = CreateObject("VBSCRIPT.REGEXP")
    With xRegEx
        .Pattern = "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"
        .Global = True
        .IgnoreCase = True
    End With
    
    For I = 1 To xRg.Rows.Count
        For J = 1 To xRg.Columns.Count
            Set xCell = xRg.Cells(I, J)
            Set xCell2 = yRg.Cells(I, J)
            If xRegEx.test(xCell.Value) Then
                arrSplit = Split(xCell.Value, "@")
                 If UBound(arrSplit, 1) = 1 Then
                    xCell2.Value = "http://www." & arrSplit(1)
                    xCell2.Hyperlinks.Add Anchor:=xCell2, Address:=xCell2.Value
                 End If
            End If
        Next
    Next
    Application.ScreenUpdating = xUpdate
End Sub


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Works perfectly in Excel 2003! Thanks much!
This comment was minimized by the moderator on the site
I'm in a MAC environment so don't have a ALT key. Any other ieas?
This comment was minimized by the moderator on the site
The equivalent for the ALT key is the command key (located to the left of the Option Key).

Both of these keys are located to the left of the spacebar.
This comment was minimized by the moderator on the site
you are a star, it worked perfectly. thanks a million
This comment was minimized by the moderator on the site
I cannot find the find converting cells to hyperlinks.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations