Compare file list with contents of folder then hyperlink
Hi! This is my first posting, so please be gentle. My organization is using Excel as a database for multiple unrelated collections of files. The database spreadsheet for each collection has a unique identifier in Column A and data describing the identified file in subsequent columns. The identifiers in column A are filenames only (not extensions) for files with several different formats.
DOCUMENT.0000001
DOCUMENT.0000002
DOCUMENT.0000003
DOCUMENT.0000004
TASK.0000001
TASK.0000002
TASK.0000003
XM.VIDEO.0000007
XM.AUDIO.0000001
XM.PHOTO.0000003
The Documents and Tasks files are almost always pdf's and are always in a subfolder called Documents and Tasks. The video, audio and photo files can have any number of file extensions; they are all gathered in a subfolder called Multimedia. The spreadsheet of data is on the same level as the subfolders.
Documents and Tasks (a subfolder)
Multimedia (a subfolder)
spreadsheet.xlsx
The material will be processed in different offices, with different drive letters and different master file names, so I can't specify the path beyond the relative path indicated above.
I have adapted the following code, which works great for one folder. As soon as I try to run a similar code for the Multimedia folder, the data overwrites and reorders. The cells must stay in the same order to maintain the integrity of the data in adjascent columns.
I need to do two things: (1) confirm that the files in the list in Column A are actually in the folders (we receive the spreadsheet and files from an outside agency that has been known to make mistakes) and (2) hyperlink the contents of the cell in Column A to the file, showing the full filename and extension as the friendly_name. As mentioned above, the cells must remain in the same order.
I've had pretty good success cobbling together the automation on this project to this point, but despite googling like crazy, I haven't been able to make it work. I would very much appreciate any help or advise. Please use small words, as this is about day 10 trying to teach myself VBA! Thanks in advance for any guidance.
Shirley
Bookmarks