+ Reply to Thread
Results 1 to 1 of 1

Replacing Hyperlinks

Hybrid View

maxwku Replacing Hyperlinks 01-06-2010, 05:37 PM
  1. #1
    Registered User
    Join Date
    01-06-2010
    Location
    U.S., Kentucky
    MS-Off Ver
    Excel 2007
    Posts
    3

    Replacing Hyperlinks

    I’m needing some help writing this macro. I have a macro written to replace an existing hyperlink with one that I desire. The problem I have is each cell has a different link, is there a way I can get the macro to copy what is in the cell into the link.

    For example the macro written bellow is for a cell called HC001. The pdf for that name is located on a driver called “fs3\HC001.pdf.” The cell bellow that is HC002, the pdf for that name is located at “fs3\HC002.pdf.” So I was wondering if there is a way for the macro to fill in that part of the hyperlink?
    Dim hLink As Hyperlink
    Dim wSheet As Worksheet
         
        For Each wSheet In Worksheets
            For Each hLink In wSheet.Hyperlinks
                hLink.Address = Replace(hLink.Address, "\\fs3\HC001.pdf", "")
            Next hLink
        Next wSheet
    
    End Sub
    Last edited by maxwku; 01-06-2010 at 10:13 PM. Reason: Added code tags. Please do so yourself in the future, thanks.

+ 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