View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AndreaSykes
 
Posts: n/a
Default Can you extract URL values from a list of cells?

This was VERY helpful for me as well. It worked great. Thanks to Microsoft
for access to this community.

"Dave Peterson" wrote:

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

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel.
Into a test cell and type:
=URL(A1)
Where A1 contained the hyperlink.


BigIan wrote:

Hi Bob,

Thanks for your reply but it's a bit advanced for me, I don't know what a
UDF is and can't find it in Excel help. I can use basic functions inside
cells and I've done some macros but that's about my limit.
Does it run like a macro and if so how do I save it and run it?

Thanks,
Ian

"Bob Phillips" wrote:

Here is a simple UDF you can use

Function URL(rng As Range)
If rng.Cells.Count 1 Then
URL = CVErr(xlErrRef)
Else
URL = rng.Hyperlinks(1).Address
End If
End Function

use like

=URL(A1)

--
HTH

Bob Phillips

"BigIan" wrote in message
...
I have a list of cells that are formatted as hyperlinks. Is there a way to
extract the URL value from each cell and create an adjacent column with
these
values in it?





--

Dave Peterson