+ Reply to Thread
Results 1 to 8 of 8

hyperlink checker VBA

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    ames, United states
    MS-Off Ver
    Excel 2010
    Posts
    4

    hyperlink checker VBA

    Hello,

    I know this has been brought up a million times but for some reason I cant get anything I have found so far to work.. I have 700 photos (on my computer not a URL address) linked into an excel spreadsheet along with other data of the photos. I have manually looked through and taken out certain photos (roughly 100) after plugging it into the spreadsheet. Now, I want to be able to highlight these broken links to make sure they aren't needed before i completely delete them from the spreadsheet. I have seen numerous vba programs so I know I am in the right area.

    Please help!
    Brandon

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: hyperlink checker VBA

    Hi Brandon,

    the following code should work

    Please Login or Register  to view this content.
    You can replace 'With objHyperlink' to 'End with' with the single instruction objHyperlink.Delete to remove the broken links
    If you like my contribution click the star icon!

  3. #3
    Registered User
    Join Date
    02-21-2013
    Location
    ames, United states
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: hyperlink checker VBA

    Hello,

    Thanks for responding. For some reason this isnt working either. It appears to have ran but no hyperlinks are in red. I know there are links broken due to finding a random few as I click on them.

    I open vba, paste code into the correct sheet, and run "ValidateHyperlinks". Please let me know what I am doing wrong. I am running excel 2010 if that makes any difference.

    Thanks again,
    Brandon

  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: hyperlink checker VBA

    Hello blgross07,

    Welcome to the Forum!

    VBA will not see Hyperlinks created using the formula "=HYPERLINK()". It will see only hyperlinks created by VBA or pasted in from an external source, like a web site.

    This macro will examine the cells on the ActiveSheet that have formulas. If the formula starts with "=HYPERLINK(", it will parse out the ADDRESS portion of the hyperlink formula and use this as the file's path. If the path is not valid then the cell will be highlighted in yellow.

    Add a new VBA Module to your workbook's VBA project and paste the macro code below into it.

    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!)

  5. #5
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: hyperlink checker VBA

    Leith, the VBA solution provided by me will also recognize hyperlinks to local objects that were inserted using the menu option.

  6. #6
    Registered User
    Join Date
    02-21-2013
    Location
    ames, United states
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: hyperlink checker VBA

    Hello,

    Thanks for all the help this far! I am definitely getting closer with Leith's code. I can get it to work properly if I manually paste in the link [EX: =HYPERLINK("\\C\examplefolder\examplepicture",examplepicture)] but not if I have the hyperlinks bound from another cell [Ex: =HYPERLINK("\\C\examplefolder\examplepicture"&B3,B3)]. Is there anything I can do to make this work still?

    Thanks again,
    Brandon

  7. #7
    Registered User
    Join Date
    02-21-2013
    Location
    ames, United states
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: hyperlink checker VBA

    Anyone have any ideas?

    Thanks for the help,
    Brandon

  8. #8
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: hyperlink checker VBA

    post removed - suggested solution does not work
    Last edited by OllieB; 03-08-2013 at 02:04 PM.

+ 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