Insert a hyperlink as the text in the cell?

  • Thread starter Thread starter Alain Dekker
  • Start date Start date
A

Alain Dekker

For the same(!) range of cells [no helper-Column]:
Use the following VBA Code after the range of cells have been selected:
-----------------------
Sub Make_HyperLink()
For Each CL In Selection
If cl.Text Like "*www*" Then
ActiveSheet.Hyperlinks.Add Anchor:=cl, Address:= cl.Text,
TextToDisplay:=cl.Text
End If
If cl.Text Like "*@*.*" Then
ActiveSheet.Hyperlinks.Add Anchor:=cl, Address:= "mailto:" & cl.Text,
TextToDisplay:=cl.Text
End If
Next
End Sub
 
Back
Top