Results 1 to 1 of 1

checking concatenated hyperlink

Threaded View

  1. #1
    Registered User
    Join Date
    08-25-2015
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    1

    checking concatenated hyperlink

    Hi Everyone!

    I come to you because I have a question about an excel file i'm working on and haven't quite been able to figure it out on my own, even with all the lurking i've done.

    I am working on a massive file with thousands of PDFs linking to my cells, and as they are broken up into batches with matching prefixes in the filename, i've found that the best way to hyperlink them all is to break up the filepath and change the parts that are changing, and concatenating them at the end into a hyperlink, sort of as i demonstrate below.
    File Name Server Path Folder File Prefix Series Suffix Hyperlink
    AB1 FILE:///\\SERVER.COM\ FOLDER\ AB 1 _SUFFIX.DOC =HYPERLINK(CONCATENATE(B1,C1,D1),A1)

    While i bet there's an even easier way to do this, this is the way i did it, and it works for what we need it for.
    That said, I'd now like to run a macro to check all the hyperlinks to make sure they are all working, and this is where i run into a problem.
    the macro I have tried to run doesn't seem to recognize these concatenated hyperlinks as hyperlinks, so it is not giving me any results. Is there something that needs to be done to trick it into thinking these are real hyperlinks? or is there a change that can be done to have the macro work with the links I have?

    this is the macro i've been trying
    Sub TestHLinkValidity()
    
    Dim rRng As Range
    Dim fsoFSO As Object
    Dim strFullPath As String
    Dim cCell As Range
    
    Set fsoFSO = CreateObject("Scripting.FileSystemObject")
    Set rRng = Selection
    For Each cCell In rRng.Cells
        If cCell.Hyperlinks.Count > 0 Then
            strFullPath = ActiveWorkbook.Path & "\" & cCell.Hyperlinks(1).Address
            If fsoFSO.FolderExists(strFullPath) = False Then
                cCell.Interior.ColorIndex = 3
            Else
                cCell.Interior.ColorIndex = 0
            End If
       End If
    Next cCell
    End Sub
    Thanks a lot in advance!
    Last edited by Dizzy50; 08-25-2015 at 05:05 PM. Reason: added macro

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] checking file exists before adding hyperlink
    By TaliKL in forum Excel General
    Replies: 8
    Last Post: 03-02-2013, 06:26 AM
  2. How to display text in a cell with a mailto concatenated hyperlink?
    By JRR007 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2012, 11:18 AM
  3. vba to Match concatenated values in concatenated columns
    By bjurick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2012, 03:45 PM
  4. Checking if last click was a Hyperlink
    By Reporter in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-19-2009, 05:51 AM
  5. different fonts concatenated
    By David Obeid in forum Excel General
    Replies: 1
    Last Post: 01-26-2008, 11:29 PM
  6. Concatenated sorting
    By JIBG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2007, 11:43 PM
  7. Checking Hyperlink
    By anton.aramayo@gmail.com in forum Excel General
    Replies: 0
    Last Post: 08-15-2006, 04:05 PM
  8. [SOLVED] Concatenated Dates?
    By Jay in forum Excel General
    Replies: 1
    Last Post: 06-15-2006, 04:10 PM

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