+ Reply to Thread
Results 1 to 6 of 6

Need to create 1,000's of links quickly

  1. #1
    Registered User
    Join Date
    02-26-2007
    Posts
    4

    Need to create 1,000's of links quickly

    Is it possible to automatically add links to each entry in a given column?

    i.e. In column A, I need each word/set of words to be hyperlinked without me having to manually do it myself.

    Something like this:

    Column A
    Smith, Joe------> http://www.mysite.com/redirect.cgi?redirect=Smith_Joe
    Thomas, Henry --> http://www.mysite.com/redirect.cgi?r...t=Thomas_Henry

    (I also need the underscore between the two names in the hyperlinks "_".)

    Is this possible?

    Thank you

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Assuming Column A has your data ("Smith, Joe"; "Johnson, Bob"; etc.), in B1 copy and paste the following formula:

    =HYPERLINK("http://www.mysite.com/redirect.cgi?redirect="&(SUBSTITUTE(A1,", ","_")))

    Then fill that down for all your rows of names.

  3. #3
    Registered User
    Join Date
    02-26-2007
    Posts
    4
    Quote Originally Posted by pjoaquin
    Assuming Column A has your data ("Smith, Joe"; "Johnson, Bob"; etc.), in B1 copy and paste the following formula:

    =HYPERLINK("http://www.mysite.com/redirect.cgi?redirect="&(SUBSTITUTE(A1,", ","_")))

    Then fill that down for all your rows of names.
    I need to actually make the names in Column A to be hyperlinks.

    i.e. I need it to look like this:

    Smith, Joe
    Last edited by Robb; 03-04-2007 at 11:51 PM.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Ok, then try this:

    Create a temporary helper row after column A and use my original formula with a slight modification in B1 downward:

    =HYPERLINK("http://www.mysite.com/redirect.cgi?redirect="&(SUBSTITUTE(A1,", ","_")),A1)

    By adding the last ",A1" it creates the hyperlink but using the 'friendly name' as seen in cell A1. Fill down to row 65,536 if necessary. Then you can copy column B and PasteSpecial->Values into Column A. Delete column B and you should be all set. This should take 30 seconds or less.

    If you want a macro to do this without taking the 30 seconds to use the formula above, then someone else will need to step in since I'm not a vba expert of any kind.

  5. #5
    Registered User
    Join Date
    02-26-2007
    Posts
    4
    Quote Originally Posted by pjoaquin
    Ok, then try this:

    Create a temporary helper row after column A and use my original formula with a slight modification in B1 downward:

    =HYPERLINK("http://www.mysite.com/redirect.cgi?redirect="&(SUBSTITUTE(A1,", ","_")),A1)

    By adding the last ",A1" it creates the hyperlink but using the 'friendly name' as seen in cell A1. Fill down to row 65,536 if necessary. Then you can copy column B and PasteSpecial->Values into Column A. Delete column B and you should be all set. This should take 30 seconds or less.

    If you want a macro to do this without taking the 30 seconds to use the formula above, then someone else will need to step in since I'm not a vba expert of any kind.
    Looks good. Thanks! One last thing...

    I have some names listed like this:

    Smith, Joe Bob

    but I want it to get linked with the ending looking like:

    Smith_Joe_Bob

    The way you showed me does the following:

    Smith_Joe Bob

    Any way around turning SPACES into UNDERSCORES?
    Last edited by Robb; 03-05-2007 at 12:13 AM.

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Sure, throw in an extra SUBSTITUTE function on top of the other one, like so:

    =HYPERLINK("http://www.mysite.com/redirect.cgi?redirect="&(SUBSTITUTE(SUBSTITUTE(A2,", ","_")," ","_")),A2)

    This will first replace the comma+space (", ") with an underscore, then it will replace any remaining spaces with underscores.

+ 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