View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
מיכאל (מיקי) אבידן מיכאל (מיקי) אבידן is offline
external usenet poster
 
Posts: 561
Default Insert a hyperlink as the text in the cell?

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
-----------------------
Micky



"Alain Dekker" wrote:

If I have cells A1-A5 as these IP addresses:
http://12.23.34.11
http://12.23.34.12
http://12.23.34.13
http://12.23.34.14
http://12.23.34.15

and they are not hyperlinks yet, is there a way to get Excel to insert a
hyperlink where the hyperlink will automatically point to the contents of
the cell itself ie. the hyperlink in cell A1 should "http://12.23.34.11" and
so on?

I know you can do this manually, but the automatic option would save a LOT
of time.

Thanks,
Alain


.