+ Reply to Thread
Results 1 to 5 of 5

retrieve hypertext link to new cell

Hybrid View

  1. #1
    Registered User
    Join Date
    12-07-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    retrieve hypertext link to new cell

    I have a list of names (3000) with hypertext link on name to an email.
    I would like to retrieve the emails to separate table cell

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: retrieve hypertext link to new cell

    With
    A1: containing a hyperlink.....eg http://www.google.com/ (displayed as: Google)

    • ALT+F11.....to open the Visual Basic Editor

    • Right-click on your workbook name in the VBA Project panel
    ...Insert: Module

    • Copy the below VBA code and paste it into that module:

    Function GetHlinkAddr(rngHlinkCell As Range)
    Dim sFormula As String
    
    With rngHlinkCell
        If .Hyperlinks.Count Then
           GetHlinkAddr = .Hyperlinks(1).Address
            
        ElseIf .HasFormula Then
            sFormula = .Formula
            If InStr(1, sFormula, "HYPERLINK") > 0 Then
                GetHlinkAddr = Split(sFormula, Chr(34))(1)
            Else
                GetHlinkAddr = "No Hyperlink"
            End If
        End If
    
    End With
    
    End Function
    Using that function in your workbook...
    This formula returns the URL referenced by that hyperlink:
    B1: =gethlinkaddress(A1)
    In the above example, the formula returns: http://www.google.com/

    Note: XL2007 and later
    When you save that workbook, you'll need to save it as a Macro Enabled (.xlsm) workbook.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    12-07-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: retrieve hypertext link to new cell

    Many thanks for your prompt reply
    I tried and could not make your offer.
    I am attaching a file with the names (in Hebrew), including e-mail link.
    I would be happy if you could do what you've written
    https://onedrive.live.com/redir?resi...nt=file%2cxlsx

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: retrieve hypertext link to new cell

    On-Line Excel does not support VBA at this time.
    You'd need to use an off-line Excel file.

  5. #5
    Registered User
    Join Date
    12-07-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: retrieve hypertext link to new cell

    Many thanks Ron
    Managed in accordance with your suggestion.

+ 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. Copy down hypertext cell range pattern & cell reference formula pattern
    By Underexcelling in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-10-2014, 03:23 AM
  2. Hi. anyone can help me to link this? userform and retrieve data problem
    By yuki0219 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2012, 11:36 AM
  3. Hypertext link to external site automation
    By Tom Throckmorto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2007, 06:22 PM
  4. [SOLVED] How do I retrieve the current workbook link in vba?
    By whylite in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-17-2006, 01:15 AM

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