Hi,
In a module include your procedure:
Sub HyperlinksToDirectory()
Cells(1, 1).Select
Dim stDir As String
Dim stFile As String
Dim R As Range
Set R = ActiveCell
stDir = InputBox("Directory?", , Default:=CurDir())
stFile = Dir(stDir & "\*.*")
Do Until stFile = ""
R.Hyperlinks.Add R, stDir & "\" & stFile, , , stFile
Set R = R.Offset(1)
stFile = Dir()
Loop
R.CurrentRegion.Sort key1:=R, order1:=xlAscending, Header:=xlNo
End Sub
Sub Avvia()
UserForm1.Show
End Sub
In Userform add:
Private Sub UserForm_Initialize()
Sheets("Foglio1").Activate
UserForm1.ListBox1.RowSource = ""
UserForm1.ListBox1.RowSource = "a1:a" & Range("A" & Rows.Count).End(xlUp).Row
End Sub
Private Sub ListBox1_Change()
If ListBox1.ListIndex < 0 Then Exit Sub
On Error Resume Next
Range(ListBox1.RowSource).Cells(ListBox1.ListIndex + 1, 1).Hyperlinks(1).Follow
Unload Me
On Error GoTo 0
End Sub