Hyperlinks

  • Thread starter Thread starter PeterM
  • Start date Start date
P

PeterM

I'm using Office2003 on XP.

I have a spreadsheet with two sheets. SheetA contains one particular column
that is a hyperlink. I"ve written VBA Code to scan SheetA and find specific
rows and copy some of the data from SheetA onto SheetB. My problem is that I
need to copy the hyperlink info from SheetA to the corresponding cell on
SheetB. I know how to add a hyperlink to a cell

Range("H26").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=
......................

however I can't figure out how to determine what the hyperlink address is
on the source cell in SheetA.

Can anyone help? Thanks in advance.
 
range("A1").Hyperlinks(1).Address will return the hyperlink in cell A1, so:
Range("H26").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:=Sheets("Sheet1").Range("H26").Hyperlinks(1).Address
should work.
Bob Umlas
Excel MVP
 
Back
Top