Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Not in KC anymore
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Convert Text To Hyperlink (XP)

    Hello,

    I've been looking for a shortcut to convert text to a hyperlink.

    For example, I have the following numbers in their own cell:

    123456
    234567
    345678
    456789

    I need to create a hyperlink to a web address that is always the same except for the number displayed in the respective cell.

    The address would be "www.google.com/123456", but the display would not change...it would still read "123456".

    Any suggestions or pointing in the right direction is greatly appreciated.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert Text To Hyperlink (XP)

    Not exactly what you want, but easily to maintain:
    Say that the numbers are in A1:A5 (or as far down as needed).
    In B1, enter the following formula:
    <code>
    =HYPERLINK("http:/www.google.com/"&A1,A1)
    </code>
    Fill down as far as needed.
    If you want to change one of the numbers, you can edit a cell in column A; the formula in column B will be updated automatically.
    If you wish, you can hide column A.

    If you prefer to make the hyperlinks in the cells themselves, select the range with the numbers, then run this macro:

    Sub MakeHyperlinks()
    Const strAddress = "http://www.google.com/"
    Dim oCell As Range
    For Each oCell In Selection
    ActiveSheet.Hyperlinks.Add Anchor:=oCell, _
    Address:=strAddress & oCell.Value
    Next oCell
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Not in KC anymore
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert Text To Hyperlink (XP)

    Perfect!

    The macro is exactly what I needed. Performs fantastically.

    The formula is definitely useful too.

    Thank you very much.

    <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •