Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reverse Hyperlink - change mailto to text

0 views
Skip to first unread message

Jaredean

unread,
Apr 21, 2009, 8:44:34 PM4/21/09
to
I have a spreadsheet that contains e-mail address, but the sheet shows
them just as:

don johnson email 123 Walnut city state

Well, the "email" is actually a link to the persons e-mail address. If
i choose "Edit Hyperlink" the link shows "mailto:te...@test.com"

What I want to do is go through the 1,000's of rows and replace the
word "email" with the actuall e-mail address (not the mailto: part,
but just the te...@test.com)...

Please help...

thanks,
jared

Michael Bednarek

unread,
Apr 22, 2009, 1:30:42 AM4/22/09
to
On Tue, 21 Apr 2009 18:44:34 -0600, Jaredean <sh...@prolook.com> wrote in
microsoft.public.excel:

Select the cellls you want to change and try this code:

Dim rngCell As Range

For Each rngCell In Selection
If rngCell.Hyperlinks.Count = 1 Then
rngCell = Mid(rngCell.Hyperlinks(1).Address, 8)
End If
Next rngCell

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"

Jaredean

unread,
Apr 22, 2009, 8:04:39 PM4/22/09
to
Thanks for the reply...sorry, my VB skills aren't what they should
be...do i start the VB editor and create a new module and paste this
code in and run it as a macro? i tried that and it didn't show up as
a macro in the list (i turned off the security, etc.)

jared

Michael Bednarek

unread,
Apr 22, 2009, 9:28:48 PM4/22/09
to
On Wed, 22 Apr 2009 18:04:39 -0600, Jaredean <sh...@prolook.com> wrote in
microsoft.public.excel:

>Thanks for the reply...sorry, my VB skills aren't what they should


>be...do i start the VB editor and create a new module and paste this
>code in and run it as a macro? i tried that and it didn't show up as
>a macro in the list (i turned off the security, etc.)
>
>jared

What you did sounds pretty good to me, except that you need to give the
code a name. Put the line
Sub Hyper1()
above the code and the line
End Sub
below it. It should then show up under that name in the list of macros,
or you can run it from the VB editor by pressing F5 when the cursor is
somewhere in the code and you have selected the cells to convert in the
worksheet.

0 new messages