+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Hyperlink with hidden path & only shows filename?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: Hyperlink with hidden path & only shows filename?

    Hi

    I looked at using VBA and the following should do what you require.

    Sub add_hyper()
    
    For crow = 2 To 74
    
    With Worksheets(1)
    
    Let a = Format(Cells(crow, 2), "hh:mm")
    Let b = Format(Cells(crow, 1), "mm-dd-yy")
    Let C = Format(Cells(crow, 2), "hh mm")
    
        .Hyperlinks.Add Anchor:=.Range("c" & crow), _
            Address:="C:\Root\4x\trades\2009 forward\01 USD-CAD\" & b & " " & C & ".pdf", _
            ScreenTip:=b & " " & C & ".pdf", _
            TextToDisplay:=a & ".pdf"
    End With
    
    Next crow
    
    End Sub
    To use the code you will need to delete existing entries then run the macro, the code should be in a standard module. One point to note is that in order to prevent users seeing/finding the hyperlink the sheet must be protected, also the screentip MUST contain some text as otherwise it will display the path.

    If you have any questions please let me know.

    regards

    Jeff
    Last edited by solnajeff; 02-14-2009 at 12:07 AM. Reason: Additonal info

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

    Re: Hyperlink with hidden path & only shows filename?

    Related thread: http://www.excelforum.com/excel-2007...d-columns.html

  3. #3
    Registered User
    Join Date
    08-05-2006
    Posts
    63

    Re: Hyperlink with hidden path & only shows filename?

    Quote Originally Posted by DonkeyOte View Post
    DonkeyOte and Solnajeff,
    Thanks a lot for all of your help. I finally arrived at a formula that works beutifully:

    =HYPERLINK("C:\Root\4x\trades\2009 forward\01 USD-CAD\"&TEXT($A14,"mm-dd-yy")&" "&TEXT($B14,"hh mm")&".pdf",TEXT($A14,"mm-dd-yy")&" "&TEXT($B14,"hh mm")&".pdf")

    This formula hides the entire path and only shows the filename. Very Cool! Thanks again to everyone for their help and I'm closing this thread as SOLVED.
    Last edited by binar; 02-14-2009 at 01:31 PM.

+ 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