+ Reply to Thread
Results 1 to 8 of 8

Convert all URLs in column to hyperlinks

  1. #1
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Convert all URLs in column to hyperlinks

    Hi there
    I have the following code in a macro which converts worksheet/cell references in cells to hyperlinks. It does it for cells in column H that are in row 3 or below and that are populated. It works great.

    Can someone please help me to adapt the code for another purpose so that each hyperlink is created from a URL in the cell, instead of being created from a worksheet/cell reference in the cell? The text for display should be simply the URL.

    Any help is greatly appreciated.
    Cheers, Stu

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Convert all URLs in column to hyperlinks

    On the first read I thought I'm sure YOU understand what you're asking (I hope so )
    But... reading it through (several times) I think I got it:
    You do not want the cell to show the entire URL after converting it to a link but yous a descriptive text.
    What you can do do is add variable and extract a porting of the RUL text before linking it and that is the text you place in TextoDisplay
    Please Login or Register  to view this content.
    Something like that, play around with it.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Re: Convert all URLs in column to hyperlinks

    Hi Keebellah
    Apologies for lack of clarity in my request.

    I just wanted to convert URLs to hyperlinks and have the URL as the text to display.

    The code is below and I thank you for taking the time to assist me.

    Cheers, Stu

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Convert all URLs in column to hyperlinks

    The code you're passing does just that.
    In cell I whatever the cell is set to hyperlink and the text displayed.
    I think you'll need to be clear about what you really want.
    Or add a sample with what you have and what you would like to see.

  5. #5
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Re: Convert all URLs in column to hyperlinks

    Sorry, I know the code works. I meant to say that, my oversight. yes sample workbooks good, i usually do. should've this time as well.

    thanks again

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Convert all URLs in column to hyperlinks

    Okay, clear, I just thought that you wanted the display text to be more explicit, it now shows the enrite url so also the column width is greater.

    If you extract part of the url like lets say the the text after the www and show the a portion of what follow like the first or second backslah your text is shorter

    so instead of

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Re: Convert all URLs in column to hyperlinks

    Oh I see what you mean. Okay thanks I will have a play around with that code that you provided above. Some of the hyperlinks are indeed very long because they are SharePoint links, so that would be useful. Much appreciated :-)

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Convert all URLs in column to hyperlinks

    Just to illustrate it
    I've attached a file with one url in I fully written out (it's repeated in L just to copy back)
    If you press the smiley the macro you sue runs and will convert I to hyperlink and the text to display as I explained.
    Edit at will and you'll make it completely suitable for anything.
    Attached Files Attached Files

+ 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. 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
  2. Converted hyperlinks to urls, return back after query update/refresh.
    By akinofotkap in forum Access Tables & Databases
    Replies: 0
    Last Post: 12-08-2014, 08:55 PM
  3. 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
  4. Replies: 1
    Last Post: 07-22-2012, 01:59 AM
  5. 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
  6. [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
  7. How to convert all rows of a text column to hyperlinks?
    By zartania in forum Excel General
    Replies: 0
    Last Post: 02-02-2005, 10:09 AM

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