Changing text to hyperlink

M

mt

I have a document with thousands of columns filled with web addresses, but they are not hyperlinks. If I go into a cell and somehow edit the address (add a space at the end, change a letter, etc) it becomes a hyperlink. How can I make all of the other cells hyperlinks to the address in each cell without going into each cell and editing it? I tried concatenating column A values to column B and adding a space, but that didn't seem to do it.

Thanks in advance for any help.
 
G

Gord Dibben

mt

David McRitchie's macro will do all at once.

Sub MakeHyperlinks()
'David McRitchie
Dim cell As Range
For Each cell In Intersect(Selection, _
Selection.SpecialCells(xlConstants, xlTextValues))
With Worksheets(1)
.Hyperlinks.Add Anchor:=cell, _
Address:=cell.Value, _
ScreenTip:=cell.Value, _
TextToDisplay:=cell.Value
End With
Next cell
End Sub

If new to VBA and Macros, visit David's "getting started" site.

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Gord Dibben Excel MVP
 
G

Gord Dibben

mt

Forgot to mention the HYPERLINK Function.

You could do it manually.

In an adjacent column enter the formula =HYPERLINK(A1)

Assumes column A contains addresses.

Drag/copy down the column.

Gord
 
M

mt

Thanks - thanks perfect.

Gord Dibben said:
mt

Forgot to mention the HYPERLINK Function.

You could do it manually.

In an adjacent column enter the formula =HYPERLINK(A1)

Assumes column A contains addresses.

Drag/copy down the column.

Gord
 
Top