Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Extracting E-mail Addresses from Hyperlinks.

Extracting E-mail Addresses from Hyperlinks

Written by Allen Wyatt (last updated September 28, 2019)
This tip applies to Excel 97, 2000, 2002, and 2003


2

Do you have a worksheet that has a bunch of e-mail addresses in it, as a series of hyperlinks? If so, you may be interested in a way to pull out those addresses and put them into cells as plain text. There are a few ways you can perform this task.

The first method is to remember that the hyperlinks for e-mail addresses all start with the text "mailto" followed by a colon. Thus, you can use a formula that will strip out the first part of the hyperlink. For instance, if the e-mail hyperlink is in cell A1, you can use this formula:

=RIGHT(A1,LEN(A1)-7)

This checks the length of the cell contents, and then extracts all of it except the first seven characters, which is the "mailto:" portion. You could also use a formula that relies on the SUBSTITUTE function:

=SUBSTITUTE(A1,"mailto:","")

If you prefer, you can use a macro to do the conversion from hyperlink to text-only e-mail address. The following single-line macro is a user-defined function that returns the converted hyperlink:

Function ExtractEmailAddress(rCell As Range)
    ExtractEmailAddress = _
      Mid(rCell.Hyperlinks(1).Address, 8)
End Function

In order to use the macro, all you need to do is use the function in some cell of your worksheet, in this manner:

=ExtractEmailAddress(A1)

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2897) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Extracting E-mail Addresses from Hyperlinks.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Missing PivotTable Data

Wonder what happened to the data behind a PivotTable? It could be in a number of places, and tracking it down could be a ...

Discover More

Stopping Automatic Changes from Being Tracked

Track Changes is a great feature for keeping track of what gets changed in a document. There are some things (such as ...

Discover More

Using the Sound Recorder

Over the years Windows has included many accessories you can use for a variety of purposes. One of the more arcane ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (menu)

Sending Single Worksheets via E-mail

Got a single worksheet that you want to e-mail to someone, but don't want them to see the rest of the worksheets in the ...

Discover More

Automatic Text in an E-mail

When creating an e-mail address hyperlink using the Insert Hyperlink dialog box, Excel allows you to enter a subject for ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 9?

2021-08-17 09:01:49

Anthony Waisanen

EXACTLY what I needed, and presented so I understood what to do. Thanks!


2020-08-26 16:46:44

Bobby

Allen, I need help. I just can't figure it out.


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.