+ Reply to Thread
Results 1 to 3 of 3

Extract URLs from range of Hyperlinks, currently only extracts the first url

Hybrid View

  1. #1
    Registered User
    Join Date
    03-02-2021
    Location
    P
    MS-Off Ver
    18.2008.12711.0
    Posts
    2

    Question Extract URLs from range of Hyperlinks, currently only extracts the first url

    I have a column filled with text that's hyperlinked, and i want to collect the url from those hyperlinks (that fulfills a "Pass" requirement) to another column; In order to get the url from the hyperlinks, and following a solution online, i created the following macro:

    Function GetURL(rng As Range) As String
         On Error Resume Next
         GetURL = rng.Hyperlinks(1).Address
    End Function
    And wrote the following function on the column i want to write urls on (In the "resume" sheet, D3):

    =IF(Selection!H3:H55="Pass";GetURL(Selection!B3:B55);"")
    Note: Selection! refers to a different sheet called "Selection".

    This however, only returns the first URL value of the first "Pass" hyperlink, while i wanted it to return all URL values from all hyperlinks that "Pass".

    Curiously, on another column ("resume", C3), using the very similar function:

    =IF(Selection!H3:H55="Pass";Selection!B3:B55;"")
    Intended to return every text (not the url, but base text) from the same selection returns every single text that fulfills "Pass" (While leaving some empty cells for false values...).

    Am I doing something wrong? Any help is appreciated.
    The excel I'm using should be anexed.
    Attached Files Attached Files
    Last edited by Gatinha123; 03-02-2021 at 05:32 PM.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Extract URLs from range of Hyperlinks, currently only exrtacts the first url

    Hello Gatinha123. Welcome to the forum.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Dave

  3. #3
    Registered User
    Join Date
    03-02-2021
    Location
    P
    MS-Off Ver
    18.2008.12711.0
    Posts
    2

    Re: Extract URLs from range of Hyperlinks, currently only exrtacts the first url

    Should be done, sorry about that

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding hyperlinks using URLs from adjacent column
    By comicb in forum Excel General
    Replies: 2
    Last Post: 06-16-2020, 11:06 PM
  2. [SOLVED] Convert all URLs in column to hyperlinks
    By Stuartzz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-10-2019, 11:34 AM
  3. manipulating urls into hyperlinks in / with cell text
    By riwiseuse in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-15-2016, 08:34 AM
  4. Macro to convert text urls to active hyperlinks
    By tdm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2012, 02:19 AM
  5. Replies: 1
    Last Post: 07-22-2012, 01:59 AM
  6. Making hyperlinks to a whole list of urls in excel
    By max11 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 09-03-2007, 12:24 PM
  7. [SOLVED] activate column of URLs as hyperlinks
    By joannavaught@gmail.com in forum Excel General
    Replies: 3
    Last Post: 11-07-2005, 05:10 PM

Tags for this Thread

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