How to Convert Multiple Email Addresses to Hyperlinks in Excel?


When we have a list of plain email addresses in Excel, It could be irritating as we can’t send mail to them directly. If we need to convert them to hyperlinks, we can do so directly, but sometimes it could be a boring and old process if we do it many times. So let us see an interesting method to complete the task using the VBA application. Read this tutorial to learn how you can convert multiple email addresses to hyperlinks in Excel.

Converting Multiple Email Addresses to Hyperlinks in Excel

Here we will first insert a VBA module and then run it to complete our task. Let's go over a simple procedure for converting multiple email addresses to hyperlinks using the VBA application.

Step 1

Let us consider an excel sheet where the data is a list of plain email addresses, similar to the below image.

Now right-click on the sheet name and select view code to open the VBA application, then click on insert and select module.

Right click > view code > insert > module

Step 2

Type the following program code in the text box as shown in the image below.

Program

Sub EmailHylink()
'Updated By Nirmal
    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", "Convert to hyperlink", 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

Step 3

Then save the sheet as a macro-enabled workbook, click F5 to run the code, select the range of email addresses, and click OK to complete our process.

Save > F5 > Select range > OK

Conclusion

In this tutorial, we used a simple example to demonstrate how you can convert multiple email addresses to hyperlinks in Excel.

Updated on: 06-Mar-2023

482 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements