怎么把大量文件(相片)的创建时间和修改时间批量导入Excel
2个回答
展开全部
Sub 按钮1_Click()
Dim i As Integer
i = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set fs = fso.getfolder(Sheet1.Cells(1, 2)).Files
With Sheet1
.Cells(i, 1) = "序号": .Cells(i, 2) = "创建时间": .Cells(i, 3) = "最后修改时间"
For Each f In fs
ex = Right(f, 4)
If ex = ".jpg" Or ex = ".bmp" Or ex = ".gif" Or ex = ".png" Or ex = ".tif" Then
i = i + 1
.Cells(i, 1) = f.Name: .Cells(i, 2) = f.datecreated: .Cells(i, 3) = f.DateLastModified
End If
Next
End With
End Sub
添加一个按钮,输入上面的代码,结果如下:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询