Get links from hyperlinks UDF

Recently, while compiling my previous blog list summary table I came across an interesting problem, how do I get a list of so many blog entries in a table (as illustrated in my previous post)??
Format: Post Title, Link
UDF (user defined function) was at rescue for me; I just had to copy and paste from the web page the list of blogs which were as hyperlinks. And after copying the following UDF helped me to extract the underlying links for the same.
blog2_image1

Option Explicit


Public Function GetHyperlink(rng As Range) As String
    If rng.Hyperlinks.Count <> 0 Then
        GetHyperlink = rng.Hyperlinks.Item(1).Address
    Else
        GetHyperlink = vbNullString
    End If
End Function

This UDF can be useful many times in other situations of the same nature while extracting data from web and documenting it.
Note: This function to act as UDF must be placed in a Module object.

The sample work book is attached for the same:

Download

Leave a Reply

Your email address will not be published. Required fields are marked *

*