Friday, June 15, 2012

Add Hyperlinks

The following procedure converts a url to a hyperlink in range:

Sub AddHyperlinks(rng As Range)
    Dim c As Range
    For Each c In rng
        If StartsWith(c.Value, "http") Then           
                c.Hyperlinks.Add Anchor:=c, Address:=c.Value
        End If   
    Next
End Sub


It uses the StartsWith function from the previous post.

No comments:

Post a Comment