+ Reply to Thread
Results 1 to 10 of 10

Hyperlinks - Text to display

Hybrid View

  1. #1
    Registered User
    Join Date
    10-06-2009
    Location
    Spain
    MS-Off Ver
    Excel 2007
    Posts
    50

    Hyperlinks - Text to display

    Hi,

    I have quite of few of cells in a column it only includes a hyperlink in the cells. The links are quite long, so the cells expands. The easy and slow, slow way to change the Text to display is by right clicking on the mouse and changing it manually each cell with a link.

    My question, is there a way to change the text to display with a function or something similar?


    Thanks
    Elegidos (Spain)
    Last edited by Elegidos; 10-12-2009 at 05:55 AM.

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

    Re: Hyperlinks - Text to display

    What is to determine the Text to Display content of each link ?

  3. #3
    Registered User
    Join Date
    10-06-2009
    Location
    Spain
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Hyperlinks - Text to display

    What I really want the text to display is the last 8 characters of the link. But if isn't posible just want to put any type of text to reduce the size of the link .

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

    Re: Hyperlinks - Text to display

    So does something like the below work for you ?

    Public Sub Example()
    Dim hLink As Hyperlink
    For Each hLink In ActiveSheet.Hyperlinks
        hLink.TextToDisplay = Right(hLink.Address, 8)
    Next hLink
    End Sub

  5. #5
    Registered User
    Join Date
    10-06-2009
    Location
    Spain
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Hyperlinks - Text to display

    Yeah!! Seems like that might work just great . The only problem is where do I put the following code? If its VBA, in excell I've never used it and don't know what to do .



    Thanks again.

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

    Re: Hyperlinks - Text to display

    In XL hold ALT and press F11 (brings up the VBE window), then ALT + I -> M and paste the above code into the resulting window.

    Back in XL you can call the subroutine either via the Tools -> Macros menu or by pressing ALT + F8, selecting routine and pressing Run.

    Obviously macros must be enabled - to check your Macro security settings use Tools -> Macros -> Security ... I would advise Medium (never Low). On medium security when opening files containing VBA you will be prompted to either Enable/Disable macros (Low will auto enable).

  7. #7
    Registered User
    Join Date
    10-06-2009
    Location
    Spain
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Hyperlinks - Text to display

    Yeah!! Seems like that might work just great . The only problem is where do I put the following code? If its VBA, in excell I've never used it and don't know what to do .

    http://www.excel-vba.com/vba-prog-1-4-editor-code.htm

+ 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