converting a column from email link to email address

mmg0924

New Member
Joined
Mar 10, 2010
Messages
6
I have an .xls spreadsheet that has a column which contains email links that appears like this: Email
When you click the cell or hover it shows the email address. I would like to convert the entire column to actually display the email address. I need to export these email adddresses once I get them. The only way I have found that I can get the email address is to create a new column, then click the Email link and it opens up an outlook email. Then I have to copy and paste the email address into the new column. I have over 2000 cells in this column. Is there any way to convert this column to the actual email addresses that are embedded in it? Any help would be appreaciated!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi

Assuming you have no other hyperlinks on this sheet, try running the following code:

Code:
Sub ConvHyperlinks()
Dim i As Long
With Sheets("Sheet1")   'amend as appropriate
    For i = 1 To .Hyperlinks.Count
        .Hyperlinks(1).TextToDisplay = .Hyperlinks(1).Address
    Next i
End With
End Sub
 
Upvote 0
I appreciate this reply, but I am a novice .xls user and don't know how to run code. Is there a way to explain? Much appreciated.
 
Upvote 0
Sure:

1. With this workbook open and the sheet in question visible on the screen, open up the Visual Basic Editor by Alt+F11 (ie hold down Alt key and tap F11 key).
2. In the VBE, insert a module by Insert>Module
3. This will open up the code area on the right of the VBE (big white space). Paste the code below into this area:

Code:
Sub ConvHyperlinks()
Dim i As Long
With Activesheet  
    For i = 1 To .Hyperlinks.Count
        .Hyperlinks(1).TextToDisplay = .Hyperlinks(1).Address
    Next i
End With
End Sub
4. Place the cursor somewhere in this code (doesn't matter where) and then tap the F5 key - this will run the macro and will convert your hyperlinks (well, that's the theory!).
 
Upvote 0
well thanks! I followed instructions as posted. It converted the 5H cell, which is the first row of the email column (H) but it left the remaining inn the column as hyperlinks showing us as Email
I also tried highlighting the email column (H) and running the code but it wasn't successful. Any other suggestions? :)
 
Upvote 0
Try this amended code (run after you have selected the cells that contain these emails):

Code:
Sub ConvHyperlinks()
Dim cell As Range
    On Error Resume Next
    For Each cell In Selection
        cell.Hyperlinks(1).TextToDisplay = cell.Hyperlinks(1).Address
    Next 

End Sub
 
Upvote 0
I have the email address column converted from the link now (thanks to you!) But here is the next minor issue.

Now the column reads as mailto:mmg0924@gmail.com

Is there a quick fix to remove the characters "mailto:" from the beginning of each cell in this column? This way I would be left with only the email address.
 
Upvote 0
Select the column and go Ctrl+H and in the Find box type "mailto:" (without quotes) and leave Replace box blank and hit Replace All.
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,785
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top