PDA

View Full Version : Solved: Hyperlink as cell text in a range



khalid79m
11-28-2008, 06:45 AM
With Range("Play")
.Locked = True
.Hyperlinks.Add Anchor:=Cel, Address:=Cel.Text
End With

Range play contains http:// adresses to calls, however these appear as text rather than a link im trying to convert them back to a link. I had this code previously which works a treat but now I need to do it based on the named range play ?



Sub Hyperlink
'Settings
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
' ( - ("A") This select the column to look at to ascertain the last row of data)

'Links
Dim Cel As Range
For Each Cel In Intersect(Range("R3:R" & lastrow), ActiveSheet.UsedRange)
' (This selects the column to look at to make a cell into a link , ("R3:R" & lastrow) only change R3:R , "R3 'is the start position and R"&lastrow is end position.
ActiveSheet.Hyperlinks.Add Anchor:=Cel, Address:=Cel.Text
Next
End sub

georgiboy
11-28-2008, 07:06 AM
For Each Cel In Range("Play").Cells

khalid79m
11-28-2008, 07:14 AM
perfect .. :)