+ Reply to Thread
Results 1 to 3 of 3

Creating new Hyperlinks

  1. #1
    Registered User
    Join Date
    06-28-2010
    Location
    Ottawa
    MS-Off Ver
    Excel 2003
    Posts
    9

    Creating new Hyperlinks

    Hi,

    One function of a program that I am writing appends a new hyperlink to the right of the last cell on the 1st row. So, each time the priogram is run, the old hyperlinks should remain and a new one should appear on the right. The issue Im having is that each time I run the code, a new hyperlink is added, but the previous one disappears...

    I dont have the code on me, but what I have done is I use the get_range function and get the individual cell, then I use the range.Hyperlinks.Add function to apply the hyperlink to the selected cell.

    Does anybody know what I should do to ensure that all old hyperlinks are kept when adding new ones?

    Thanks!

    Rich

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Creating new Hyperlinks

    Hello Rich,

    Welcome to the Forum!

    It is difficult to give you an exact answer without the seeing code. Let's say the last cell in row 1 is Q1 and this cell has the old hyperlink. If you add a hyperlink to cell R1 then the hyperlink in cell Q1 should still be there.

    If you add the new hyperlink to cell Q1 then you will lose the old text and the new text will be shown. If you are trying to add more than one hyperlink to the cell then newest added hyperlink is displayed and the previous hyperlink is removed.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Creating new Hyperlinks

    Hi Rich;

    I'm guessing that your Get_Range function does something similar to this

    Please Login or Register  to view this content.
    That gives the macro the column # of the last non empty cell in Row 1.
    you probably need to add the line
    Please Login or Register  to view this content.
    and use lNextCol instead of lLastCol to create the Hyperlink.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

+ 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