removing mailto link to display the needed data

traygiddens

New Member
Joined
Nov 2, 2005
Messages
2
i have a excel sheet that has various fields on it but i need to modify one Column..

it has a hyperling that say's "click to email" then the source underneath it has "mailto:jack@wherever.com" what i want to do is remove the "click to email" display and remove the "mailto:" part of the source so that i'm left with just the email address "jack@wherever.com" in that column....

How do i accomplish this... it's probably simple , but i don't really use exel too much and i'm stymied...

Thanks...

Tray
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
900 times

oh, by the way, i've got to do this 900 times so if there is an automated way to do this it would be preferable :-?
 
Upvote 0
Try this macro:

Code:
Sub Test()
    Dim Sh As Worksheet
    Dim Rng As Range
    Dim HL As Hyperlink
    Set Sh = Worksheets("Sheet1")
    With Sh
        Set Rng = .Range("A1:A" & .Cells(.Rows.Count, 1).End(xlUp).Row)
    End With
    MsgBox Rng.Hyperlinks.Count
    MsgBox Rng.Rows.Count
    For Each HL In Rng.Hyperlinks
        HL.TextToDisplay = Replace(HL.Address, "mailto:", "")
        HL.Delete
    Next HL
End Sub
 
Upvote 0
Another possible solution.
Code:
Sub convert_mail_to_text()
Dim rng As Range
Dim cell As Range
'names in column A starting at row 2
Set rng = Worksheets(1).Range("A2:A" & _
          Worksheets(1).Range("A" & Rows.Count).End(xlUp).Row)
For Each cell In rng
    With cell
        .Hyperlinks.Delete
        .Font.Underline = False
        .Font.Color = vbBlack
    End With
Next cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,222,143
Messages
6,164,178
Members
451,880
Latest member
2da

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