VBA 覚書02 ― 2007/07/08 19:17
Sub Test()
Dim i As Long
With Application.FileSearch
.NewSearch
.LookIn = "C:\seven"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = True
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Cells(i + 1, 1) = .FoundFiles(i)
Cells(i + 1, 3) = FileDateTime(.FoundFiles(i))
Next i
End If
End With
End Sub
Dim i As Long
With Application.FileSearch
.NewSearch
.LookIn = "C:\seven"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = True
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Cells(i + 1, 1) = .FoundFiles(i)
Cells(i + 1, 3) = FileDateTime(.FoundFiles(i))
Next i
End If
End With
End Sub