hyperlinks

J

john sharkey

I would like to get the information from a hyperlink to
appear in another cell. I have copied a column of
hyperlinks into excel. I browse over the links and it
gives certain information. I would like to access that
info.

The exact case is:

I have a list of clients that are listed as hyperlinks.
When I browse, it gives me the ID of the account executive
handling the client.

I paste the list into excel. Is there a way to have the
AE's number to appear in the next coulumn?
 
D

Dick Kusleika

John

You should be able to do this with VBA. Can you give an example of a
hyperlink and what you want to appear in the next cell.
 
D

Dave Peterson

One way to extract those URL's from a hyperlink created via Insert|Hyperlink
is with a userdefinedfunction.

Here's one that may help:

Option Explicit
Function GetURL(Rng As Range) As String
Application.Volatile

Set Rng = Rng(1)

If Rng.Hyperlinks.Count = 0 Then
GetURL = ""
Else
GetURL = Rng.Hyperlinks(1).Address
End If
End Function

So if you had a hyperlink in A1, you could put =getURL(a1) in that adjacent
cell.

Be aware that if you change the hyperlink, then this formula cell won't change
until your workbook calculates.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top