+ Reply to Thread
Results 1 to 4 of 4

Defined Function to extract URL from HYPERLINK formula

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2003
    Posts
    29

    Defined Function to extract URL from HYPERLINK formula

    Hi everyone,
    I'm using the following UDF to extract URLs from hyperlinks on a sheet, so that people can click the hyperlinks, but the URLs for all the links also appear (in the cells with formula =GetUrl), but in a place where they're accessible but out of view:

    Please Login or Register  to view this content.

    The problem is that multiple people edit the sheet, and while I apply hyperlinks the way I was taught, with a formula: =HYPERLINK("URL","Name"), others apply hyperlinks using the right-click menu, which I have to go back and fix (otherwise the links tend to get buggy when the sheet is shared).

    Frustratingly, the UDF only works on hyperlinks that were originally applied the WRONG way (using the right-click method). It does not extract URLs from the formulas, which is what I want. Should I define hyperlinks differently in the function, or is the problem that I'm targeting a cell and not the formula, or what?

    Thanks in advance.....
    Last edited by tpillow; 08-05-2009 at 05:08 AM. Reason: solved

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Defined Function to extract URL from HYPERLINK formula

    Inserted hyperlinks have the Properties & Methods associated with Hyperlink object, the Function does not... you would need to analyse the Function itself...as you can tell from the below this could get quite messy unless your links all follow a similar patter and function is not embedded within other functions etc...

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-09-2009
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Defined Function to extract URL from HYPERLINK formula

    In my case, the HYPERLINK formula is not embedded within any other formula. This seems to work on all my links, though I imagine it would not work with, for example, MAILTO links.

    So thanks a lot.

  4. #4
    Registered User
    Join Date
    02-20-2014
    Location
    Bethesda, MD
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Defined Function to extract URL from HYPERLINK formula

    Thanks! This was very helpful!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1