excel hyperlink for e-mail address

P

praterj

is there a way to move e-mail addy in column to separate e-mail hyperlink for each record in column?
 
D

Dave Peterson

One way to extract those URL's from a hyperlink created via Insert|Hyperlink
is with a userdefinedfunction.

Here's one that may help:

Option Explicit
Function GetURL(Rng As Range) As String
Application.Volatile

Set Rng = Rng(1)

If Rng.Hyperlinks.Count = 0 Then
GetURL = ""
Else
GetURL = Rng.Hyperlinks(1).Address
End If
End Function

So if you had a hyperlink in A1, you could put =getURL(a1) in that adjacent
cell.

Be aware that if you change the hyperlink, then this formula cell won't change
until your workbook calculates.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=========
I ended up with things like:
mailto:[email protected]

if you didn't want the mailto: prefix, you could adjust the macro or adjust the
result:

=mid(b1,8,255)
 
Top