Results 1 to 3 of 3

Thread: Is it possible to edit hyperlinks via vba in Excel

  1. #1
    Join Date
    Feb 2012
    Posts
    11

    Is it possible to edit hyperlinks via vba in Excel

    I am moving an Excel spreadsheet with about 3000 hyperlinks from C: drive to U: drive (server) and need to revise the hyperlinks accordingly. While I'm at it, I can take an unnecessary folder (....../folder/....) out of the address. I tried writing VBA to do this without success. Suggestions? Thank you in advance.

  2. #2
    Join Date
    May 2011
    Posts
    523

    Re: Is it possible to edit hyperlinks via vba in Excel

    Try this out :
    Code:
    Sub Fix192Hyperlinks()
    Dim OldStr As String, NewStr As String
    OldStr = "http://192.168.15.5/"
    NewStr = "http://hank.home.on.ca/"
    Dim hyp As Hyperlink
    For Each hyp In ActiveSheet.Hyperlinks
    hyp.Address = Replace(hyp.Address, OldStr, NewStr)
    Next hyp
    End Sub
    If you want to fix the display text you can also include .TextToDisplay

  3. #3
    Join Date
    Aug 2011
    Posts
    695

    Re: Is it possible to edit hyperlinks via vba in Excel

    This is helpful but I think it doesn't solve my problem. It looks like this solution replaces old with new. I need to edit each hyp the same way (ie c:\target\folder\folder\filename to u:\target\folder\filename) because each hyp goes to a different file.

Similar Threads

  1. How to edit multiple hyperlinks of Excel at a single time
    By De-Dg in forum MS Office Support
    Replies: 5
    Last Post: 24-02-2012, 12:15 PM
  2. Replies: 2
    Last Post: 17-02-2012, 05:36 PM
  3. How to avoid the Automatic Creation of Hyperlinks in Excel?
    By sivaranjan in forum Windows Software
    Replies: 5
    Last Post: 11-03-2010, 04:41 AM
  4. How to move hyperlinks in Excel
    By Abel18 in forum Windows Software
    Replies: 5
    Last Post: 18-12-2009, 12:49 PM

Tags for this Thread

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
  •  
Page generated in 1,715,003,249.95732 seconds with 17 queries