Category Archives: Visual Basic

Bulk Extract Hyperlink from Excel Cells

Alas there is no pre-defined function for extracting a hyperlink from an Excel cell. Therefore the easiest way to accomplish this is to create our own function using a macro.

Within Excel, open up the VBA Macro Interface:
Alt + F11

From the VBA interface, goto the menu and select:
Insert -> Module

On the module screen that opens up, paste in the following text:

Function HyperExtract(content As Range) As String
    On Error Resume Next
    HyperExtract = content.Hyperlinks(1).Address
End Function

Save your spreadsheet (you’ll now need to save it as a *.xlsxm format) and close the VBA screen.

Voila!