+ Reply to Thread
Results 1 to 10 of 10

Editing HyperLinks

  1. #1
    Registered User
    Join Date
    07-31-2007
    Posts
    6

    Editing HyperLinks

    Hi

    I need to edit the hyperlinks in my excel sheet. I know how to do this manually and edit one at a time, but I need to change 3000 of them!

    Is there a way I can do this without going through each one?

    Thanks in advance

    Simba

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon simba_cubs

    ...and welcome to the forum!!

    I need to edit the hyperlinks in my excel sheet
    What do you mean by "edit"? Can you provide some examples as to what you have to do to each one?

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    07-31-2007
    Posts
    6
    Yes of course.

    Currently I have 3000 hyperlinks which point to http://webserver/dir1/dir2/filename

    I need to change this to c:\inetpub\dir1\dir2 - keeping the same filenames

    Hope that make sense?

    Thanks

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi simba_cubs

    **BACK UP YOUR WORK**

    Then, on a copy of your workbook, arrow to the first hyperlink, then hold down shift and navigate to the last hyperlink and left click on it. This should now have selected all the hyperlinks.

    Now run this macro and it should go through all links replacing the path and leaving the file unchanged.

    Please Login or Register  to view this content.
    HTH

    DominicB

  5. #5
    Registered User
    Join Date
    07-31-2007
    Posts
    6
    Hi DominicB

    Thanks for your quick reply.

    I created a macro and ran it against the worksheet, but I received the following error :^(


    Run-time error '5':

    Invalid procedure call or argument.

    Any idea's?

    Thanks

    Simba

  6. #6
    Registered User
    Join Date
    07-31-2007
    Posts
    6

    Smile

    Hi DominicB

    It's worked! It changed the links even though I received the error I posted previous to this message.

    Although it seems to have changed the links, why would I receive the error message. Sorry but I'm a bit of a newbie when it comes to macro's of that nature :^|

    Thanks again in advance

    Simba

  7. #7
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi simba_cubs

    The code worked fine on my machine without any errors, but I only tested it on a range of 4 (consecutive) very simple hyperlinks. Without seeing your file and exactly where the macro stopped I couldn't say what the problem is, but I hope it is now sorted and has saved you a few hours of laborious work.

    DominicB

  8. #8
    Registered User
    Join Date
    07-31-2007
    Posts
    6
    It certainly has thanks

    I've just noticed it hasn't kept the filenames. The link now appears
    as c:\inetpub\dir1\dir2\.pdf instead of c:\inetpub\dir1\dir2\filename.pdf

    Although it does show the data in the "text to display", but in the hyperlink it just states the c:\inetpub\dir1\dir1.pdf

    Is there a where I can keep the filenames but just change the path to the file?

    Thanks

    Simba

  9. #9
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi simba_cubs

    OK. Go back to your original files - again remembering to try this on copies only.

    After I posted the code yesterday I thought of a slightly simpler way of doing things. Try using this code instead and see how things go :

    Please Login or Register  to view this content.
    HTH

    DominicB

  10. #10
    Registered User
    Join Date
    07-31-2007
    Posts
    6

    Smile

    Hi DominicB

    It's worked! Thanks ever so much, really appreciate it.

    Thanks again

    Simba

+ 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