Excel Guides

Extracting E-mail Addresses from Hyperlinks in Excel

There are a few ways to extract e-mail addresses from hyperlinks in Excel. One way is to use a simple macro. Another way is to use a more sophisticated method that involves using regular expressions. And yet another way is to use a third-party tool such as the Email Address Extractor.

Method 1: Use a Macro

Using a macro is the simplest way to extract e-mail addresses from hyperlinks in Excel. To do this, follow these steps:

  1. Open the workbook that contains the hyperlinks from which you want to extract e-mail addresses.
  2. Press Alt+F11 to open the Visual Basic Editor.
  3. In the Project Explorer window, double-click on ThisWorkbook.
  4. Click Insert > Module, and then paste the following code into the module:
Sub ExtractEmail() 
Dim cell As Range 
For Each cell In Selection 
If cell.Hyperlinks.Count > 0 Then 
cell.Value = cell.Hyperlinks(1).Address 
End If 
Next cell 
End Sub
  1. Press F5, or click Run Sub/UserForm on the toolbar, to run the macro.

Move beyond 

Excel

Get started with Causal today.
Build models effortlessly, connect them directly to your data, and share them with interactive dashboards and beautiful visuals.