Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Links / January 2008

Tip: Looking for answers? Try searching our database.

help creating new hyperlinks programmatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J - 13 Jan 2008 22:17 GMT
I'm using a macro to create new hyperlinks from URLs extracted from cells in
another column (see macro below).

   Dim HL As Hyperlink
   For Each HL In ActiveSheet.Hyperlinks
       HL.Range.Offset(0, 1).Value = HL.Address
   Next

The new hyperlinks are only text fields, however, since the address being
copied from each existing hyperlink cell is saved as the value of the
corresponding new cell.  How do I copy the address of each existing cell to
the address of the new cell to create a real, clickable hyperlink?

Thx,

J
Bill Manville - 14 Jan 2008 08:15 GMT
Sorry, but I am probably being dense.

If I understand you correctly, if you have a hyperlink in A2 you want
to create a hyperlink in A3 which, when clicked will take you to A2 ?

Sub Test()
 Dim HL As Hyperlink
 For Each HL In ActiveSheet.Hyperlinks
   ActiveSheet.Hyperlinks.Add HL.Range.Offset(0, 1), "", _
        HL.Range.Address
 Next
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.