C Clark Murray Sep 16, 2003 #1 If you have entries in cells that contain mailto hyperlinks, is there any way to reference only the mailto address from another cell?
If you have entries in cells that contain mailto hyperlinks, is there any way to reference only the mailto address from another cell?
D Dave Peterson Sep 16, 2003 #2 You could use a user defined function: Option Explicit Function GetLink(Rng As Range) As String Application.Volatile Set Rng = Rng(1) If Rng.Hyperlinks.Count = 0 Then GetLink = "" Else GetLink = Rng.Hyperlinks(1).Address End If End Function So if cell A1 contained a link to mailto:[email protected] then =getlink(a1) would return this: mailto:[email protected] If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm
You could use a user defined function: Option Explicit Function GetLink(Rng As Range) As String Application.Volatile Set Rng = Rng(1) If Rng.Hyperlinks.Count = 0 Then GetLink = "" Else GetLink = Rng.Hyperlinks(1).Address End If End Function So if cell A1 contained a link to mailto:[email protected] then =getlink(a1) would return this: mailto:[email protected] If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm