May 16, 2008

Extract Hyperlink Address From Cell

'This UDF will extract the underlying address from a cell containing a Hyperlink

'http://www.ozgrid.com/News/excel-named-ranges.htm#ExcelTips

Function GetAddress(HyperlinkCell As Range)

'If using Excel 97 use the WorksheetFunction.Substitute in place of Replace

GetAddress = Replace _
(HyperlinkCell.Hyperlinks(1).Address, "mailto:", "")

End Function