Here you go:
Option Explicit
Sub CREATEPDFDIRECTORY()
Dim f As Integer
Dim myFolder, myFile
Dim fso As Object, fPath As String
Dim path As String
path = "Path" '<-- Replace with your own path
' Use File System Object to manage files in folder
Set fso = CreateObject("Scripting.FileSystemObject")
fPath = path
Set myFolder = fso.GetFolder(fPath).Files
' Check each file sequentially and create hyperlinks accordingly
For Each myFile In myFolder
If UCase(Right(myFile.Name, 4)) = ".PDF" Then
f = f + 1
Range("A" & f).Value = myFile.Name
ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & f), _
Address:=path & myFile.Name, TextToDisplay:=fso.GetBaseName(myFile)
End If
Next myFile
' clean up
myFile = vbNullString
End Sub
Enjoy
Bookmarks