Sub 列出資料夾檔案名稱()
Dim fs, f, fc, f1
Set fs = CreateObject("Scripting.FileSystemObject")
a = Application.InputBox("請輸入存放路徑:")
Range("a1").Select
Set f = fs.GetFolder(a)
Set fc = f.Files
[A1:B1000] = ""
For Each f1 In fc
With ActiveCell
.Value = Split(f1.Name, ".")(0)
.Offset(0, 1).Value = f1.DateLastModified
.Offset(1, 0).Select
End With
Next f1
Set fs = Nothing: Set f = Nothing: Set fc = Nothing
End Sub作者: rouber590324 時間: 2021-7-29 16:53