OzGrid

Excel: Get Underlying Hyperlink Address

< Back to Search results

 Category: [Excel]  Demo Available 

Excel: Get Underlying Hyperlink Address

 

Got any Excel/VBA Questions? Free Excel Help

This UDF will extract the underlying address from a cell containing a hyperlink 

The Code

Function GetAddress(HyperlinkCell As Range)

    GetAddress = Replace _

    (HyperlinkCell.Hyperlinks(1).Address, "mailto:", "")

End Function


To use this UDF push Alt+F11 and go Insert>Module and paste in the code. Push Alt+Q and save. The Function will appear under "User Defined" in the Paste Function dialog box (Shift+F3). Use the Function in any cell as shown below. 

=GetAddress(A1)
Where cell A1 has a Hyperlink within it.

 

Microsoft ® and Microsoft Excel ® are registered trademarks of Microsoft Corporation. OzGrid is in no way associated with Microsoft

See also:

Convert Excel Formulas from Relative to Absolute
Custom Excel Formulas - User Defined Functions/Formulas
Parse/Extract File Name from Full File Name and Path
Excel: Get Maximum Number Between 2 Numbers
Group Excel Worksheets/Sheets by Color
Hide Pivot Table Fields Pivot Items by Criteria

 

See also Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions.

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.


Gallery



stars (0 Reviews)