View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Kevin Smith[_2_] Kevin Smith[_2_] is offline
external usenet poster
 
Posts: 47
Default Macro to create hyperlink

Hello,

this works on the activecell

Dim MyHyper As String
MyHyper = ActiveCell.Value
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
MyHyper, TextToDisplay:=MyHyper

or if you wanted to, you could specify the cell by

Dim MyHyper As String
range("A1").select
MyHyper = ActiveCell.Value
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
MyHyper, TextToDisplay:=MyHyper

hope that helps.
--
Kevin Smith :o)


"JoeP" wrote:

I have cells in an Excel 2003 spreadsheet that contains the path to a file. I
would like to create a macro that takes the content of an active cell (that
has a path to a file) and convert it to a hypelink to that file.
Any help would be appreciated.