| 
    
     |  | ▼ぴょんきち さん: 
 こんにちは
 
 とりあえず、フォルダを指定して、そのフォルダ内のファイルを抽出する部品を2種類。
 サブフォルダは対称にしていません。必要なら可能ですけど。
 取り出したファイルをシートに編集する部分はおできになりますね。
 
 Sub Sample1()
 Dim myPath As String
 Dim myFile As String
 myPath = Get_Folder
 If myPath = "" Then Exit Sub
 myFile = Dir(myPath & "\")
 Do While myFile <> ""
 MsgBox myFile
 'ここでシートにファイル名を追加編集
 myFile = Dir()
 Loop
 End Sub
 
 Sub Sample2()
 Dim myPath As String
 Dim myFile As Object
 Dim myFso As Object
 myPath = Get_Folder
 If myPath = "" Then Exit Sub
 
 Set myFso = CreateObject("Scripting.FileSystemObject")
 
 For Each myFile In myFso.getfolder(myPath).Files
 MsgBox myFile.Name
 'ここでシートにファイル名を追加編集
 Next
 
 Set myFso = Nothing
 
 End Sub
 
 Private Function Get_Folder() As String
 Dim ffff
 Dim WSH As Object
 
 Set WSH = CreateObject("Shell.Application")
 Set ffff = WSH.BrowseForFolder(&O0, "フォルダを選択してください", &H1 + &H10)
 If ffff Is Nothing Then
 Get_Folder = ""
 Else
 Get_Folder = ffff.Items.Item.Path
 End If
 
 End Function
 
 
 |  |