获取文件夹内所有文件名
http://club.excelhome.net/thread-1403375-1-1.html
Sub PFL() 'return file names under specific folder
Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row + 1).ClearContents
Dim fp, Fname As String, i As Integer, obmapp As Object
i = 1
Set obmapp = CreateObject("Shell.Application").BrowseForFolder(0, "Select PDF Folder", 0, 0)
If Not obmapp Is Nothing Then
fp = obmapp.self.Path & "\*.*"
Else
MsgBox "You didn`t select any folers"
Exit Sub
End If
Fname = Dir(fp)
Do While Fname <> ""
ThisWorkbook.Sheets(1).Range("A" & i + 1) = Left(Fname, Len(Fname) - 4)
Fname = Dir
i = i + 1
Loop
'Range("A" & Cells(Rows.Count, 1).End(xlUp).Row).NumberFormatLocal = "@"
End Sub