Hyperlinks

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.
 
B

Bob Umlas

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top