View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Hyperlink coding in VBA

Graham,

Take a look at this sample code and you can adjust according to your needs.
This will create a hyperlink in A1 of the activesheet that will take you to
A1 of Sheet2.

With ActiveSheet
.Hyperlinks.Add Anchor:=.Range("A1"), Address:="",
SubAddress:="Sheet2!A1", TextToDisplay:="Click Me!"
End With



--
Hope that helps.

Vergel Adriano


"Graham Y" wrote:

I want to create a hyperlink to a cell I hae just put some updated text in,
here is my code...
it runs down the first collumn looking to match a name, when found then puts
the values in the cells. All fine, but now I want to add a hyperlink to that
cell.
This code is within a WITH block for the destination sheet.

ActiveSheet.Hyperlinks.Add Anchor:=Sheets("Changes").Cells(y, 1), _
Address:=.Cells(yds, xds), TextToDisplay:=name

I ended up with the link looking for file called EX0009 which is actually
the contents of cell .Cells(yds,xds)
What I actually want is a link to this cell.
I may create hundreds of such links.
TIA