+ Reply to Thread
Results 1 to 4 of 4

Altering Hyperlinks Macro

  1. #1
    Registered User
    Join Date
    05-14-2009
    Location
    Barry, Wales
    MS-Off Ver
    Excel 2002
    Posts
    4

    Altering Hyperlinks Macro

    Can anyone help. I am new to all this and have a problem that is simple to solve but I am stuck.

    I have numerous worksheets with thumbnail images inserted and hyperlinked to the full size image. I need to edit all the hyperlinks at once as the file addresses have changed and I dont want to edit them manually.

    I have found a code to run which works well (see below) which specifies the old folder structure and allows you to replace it with a new one.

    my folder structure to the files is as follows:

    c:\folder a\folder b\variable folder name\file name

    How can i specify the variable folder names without having to alter it every time. The replace ment folder name will be the same for all the links. I am sure it is easy but my limited knowledge has failed me.
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 05-07-2011 at 01:26 PM. Reason: Added Code Tags

  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,258

    Re: Altering Hyperlinks Macro

    Hello Dalmanites,

    I modified your macro. This will work as long as the the "variable folder name" is always in the fourth folder position. The Split function creates a zero based array of strings separated by the "\" delimiter. Because of this, there is no additional code needed to separate and reattach the file name at the end.
    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    05-14-2009
    Location
    Barry, Wales
    MS-Off Ver
    Excel 2002
    Posts
    4

    Re: Altering Hyperlinks Macro

    Thanks for the code it works great but it does not leave the file name and extension at the end of the link.

    eg. c:\folder a\folder b\variable folder name\name.jpg
    becomes
    c:\folder a\folder b\new folder name

    with no filename on the end of it.

    My actual file structure makes the variable folder the 5th not the 4th therefore I amended the (3) in your code to (4). Is this correct?

    Again many thanks for the help.

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

    Re: Altering Hyperlinks Macro

    Hello Dalmanites,

    Since the test code runs on my computer, I will need to see your workbook to resolve the problem. Can you post a copy?

+ 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