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