+ Reply to Thread
Results 1 to 4 of 4

Get hyperlink with place in document from cell

Hybrid View

  1. #1
    Registered User
    Join Date
    03-05-2013
    Location
    bury
    MS-Off Ver
    Excel 2010
    Posts
    2

    Get hyperlink with place in document from cell

    Hi,
    I have aspreadsheet with lots of hyperlinks in and I want to extract the hyperlink using a custom function. I have found this code which does what I want for a pure hyperlink e.g. to another document or web site. But it doesn't work for hyperlinks to a specific tab in a wokbook. i.e. if the user has created a place in this document element to the hyperlink it doesnt work. How could I make this work for these type of hyperlinks also?
    Function GetAddress(rng As Range)
        GetAddress = rng.Hyperlinks(1).Address
    End Function

    Thanks,
    Dan
    Last edited by JosephP; 03-05-2013 at 12:12 PM. Reason: add code tags

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Get hyperlink with place in document from cell

    perhaps
    Function GetAddress(rng As Range)
        With rng.Hyperlinks(1)
            GetAddress = .Address & .SubAddress
        End With
    End Function
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    03-02-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Get hyperlink with place in document from cell

    Hyperlinks(1).SubAddress will give you the local address within the worksheet.

  4. #4
    Registered User
    Join Date
    03-05-2013
    Location
    bury
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Get hyperlink with place in document from cell

    Awsome, Thanks guys that works a treat.

+ 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