Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Speed up Hyperlinks.Add (26,000 entries)

Status
Not open for further replies.

jcfraun

Technical User
Dec 13, 2008
51
US
I have exported a file from an Access query to Excel.

In the query, three of the fields are hyperlinks, but in Excel they show up as text. There are about 26,000 lines and I need to (as quickly as possible) convert them to actual hyperlinks. They are showing up as:
FriendlyLinkName# Actual Link

The macro I wrote to convert one column of links is below:

Dim AddressLink, FriendlyNameLink As String
For i = 2 To Columns("A").Find("").Row - 1
AddressLink = Right(Cells(i, 1), Len(Cells(i, 1)) - InStr(Cells(i, 1), "#") - 1)
FriendlyNameLink = Left(Cells(i, 1), InStr(Cells(i, 1), "#") - 1)
With Worksheets(1)
.Hyperlinks.Add .Range("C" & i), AddressLink, TextToDisplay:=FriendlyNameLink
End With
Next i
End Sub

This works, but it's time-consuming and the resulting file is huge. Any tips?

Thanks!
 
I figured this out - it is smaller and faster to add formulas (=HYPERLINK) in new columns and then copy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top