SATEAT,
The following macro will create hyperlinks to the intended files
Notes:
-Change the FldrLoc to the path of the folder that contains the files- Make sure to include the ending slash \
Sub testpart()
Dim FldrLoc As String: FldrLoc = "C:\Test Folder\Test Subfolder\"
Dim rngCriteria As Range: Set rngCriteria = ActiveSheet.Range("A1:A100")
Dim CurrentFile As String, iCell As Range, rngAnchor As Range
For Each iCell In rngCriteria
If IsEmpty(iCell) = False Then
CurrentFile = Dir(FldrLoc)
Do While CurrentFile <> vbNullString
If InStr(1, CurrentFile, iCell.Value, vbTextCompare) > 1 Then
Set rngAnchor = ActiveSheet.Cells(iCell.Row, Columns.Count).End(xlToLeft).Offset(0, 1)
ActiveSheet.Hyperlinks.Add _
Anchor:=rngAnchor, _
Address:=FldrLoc & CurrentFile, _
TextToDisplay:=CurrentFile
End If
CurrentFile = Dir()
Loop
End If
Next iCell
End Sub
Hope that helps,
~tigeravatar
Bookmarks