excel VBA自动抓取指定文件夹内文件名及创建时间
展开全部
试试
Sub text()
Dim f$, p$
p = ThisWorkbook.Path & "\"
f = Dir(ThisWorkbook.Path & "\*.xls")
Do While f <> ""
Cells(Rows.Count, 1).End(3).Offset(1) = f
Cells(Rows.Count, 2).End(3).Offset(1) = CreateObject("Scripting.FileSystemObject").getfile(p & f).datecreated
f = Dir
Loop
End Sub
Sub text()
Dim f$, p$
p = ThisWorkbook.Path & "\"
f = Dir(ThisWorkbook.Path & "\*.xls")
Do While f <> ""
Cells(Rows.Count, 1).End(3).Offset(1) = f
Cells(Rows.Count, 2).End(3).Offset(1) = CreateObject("Scripting.FileSystemObject").getfile(p & f).datecreated
f = Dir
Loop
End Sub
追问
在这个代码加时间显示怎么弄啊?
Sub Macro1()
Dim wj As String
wj = Dir("\\公用办公\FangCloudSync\公共盘\销售\报价单\成本分析表\恒坤" & "\*.*")
s = 1
Do While wj ""
s = s + 1
Cells(s, 4) = wj
wj = Dir
Loop
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询