|
'撰写:老朽
'网址:http://Club.ExcelHome.net
'日期:2009-8-4 下午 07:39:49
Sub zldccmx()
'引用 Microsoft Scripting Runtime
Dim Fso As New FileSystemObject
' Set fso = CreateObject("Scripting.FileSystemObject")
Dim Pat_H, Curfiles, Mf, Mfs(1 To 1000, 1 To 2)
Pat_H = Application.GetOpenFilename("请选择一个目录 (*.jpg), *.jpg", , "请选择一个文件以确定目录")
If Pat_H = False Then Exit Sub
Pat_H = Left(Pat_H, InStrRev(Pat_H, "\"))
Set Curfiles = Fso.GetFolder(Pat_H).Files
i = 1
For Each Mf In Curfiles
Mfs(i, 1) = Mf.Name
Mfs(i, 2) = Mf.DateLastModified & vbLf
i = i + 1
Next
Sheets.Add.[A1].Resize(i - 1, 2) = Mfs
End Sub |
|