Hi everyone,
I have the following code:
Sub Apply_Hyperlinks1()
Dim r As Range
Dim myval As String
For Each r In Range("K1:K3000")
If InStr(r, "http://") > 0 Or InStr(r, "www.") > 0 Then
myval = r.Value
Range(r.Address).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=myval, TextToDisplay:=myval
End If
Next r
Range("K1").Select
End Sub
This code is supposed to go through column K and convert any test strings within each cell starting with http:// or www. from a string to hyperlink. It is possible that other text will be in the cell which should not be converted to a hyperlink; on text that starts with http:// or www.
When I run the code I get run-time error 13 and the if InStr line is indicated. Any ideas?
Thanks!
Bookmarks