If partial match in file names, generate hyperlink

  • Hey Wizards,

    On Excel spreadsheet:
    A3 has a path to folder, like C:\Users\Auser\Documents\FolderA\
    Cells A6 & down have a list of values, like 00K12345 per cell

    Folder from path in A3 has files named as such: 12 20191002 ABC123 00K12345.PDF

    Need: in corresponding cells in B6 & down:
    If value from A is found in one of the files in A3 folder
    Then generate hyperlink to it with value from A as friendly name
    Otherwise populate "Not found"

    So far only have the below code which returns true/false if link is valid, but obviously that doesn't get it done

    Function HLinkTrueFalse(path As String) As Boolean
        If Dir(path) <> vbNullString Then HLinkTrueFalse = True
    End Function
  • Done both, but:
    Formula returns "Not Found" even though manual search confirms file is there
    I want to reiterate that search criteria in A6 & down is only partial of file names in A3 folder

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!