I currently have two columns. Column A contains a list of file names (with extension) and column B contains the date it was last modified. I wanted to create a macro that loops through the list of files and scans through a file path with folders and subfolders and prints the exact link to the table in column C. It should be noted that the subfolders contain the same files which have been created/modified on different dates, however I wish to obtain the link to the file with the same timestamp as column B. I have written a few lines of code but I am struggling to put together the logic needed.
Sub tester()
path = ""
fname = "Book1.csv"
x = Dir(path & "\" & fname)
If x = fname Then
link = path & "\" & fname
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(link)
created = f.DateCreated
Else
link = "Not Found"
End If