Option Explicit

Sub dirtst()

    Dim f As String, i As Long
        
    f = Dir("C:\Users\i\Downloads\")
    Cells(1, "A") = f
    i = 2
    Do While f <> ""
    f = Dir
    Cells(i, "A") = f
    i = i + 1
    Loop
    
End Sub

f = Dir("C:\Users\i\Downloads\*.xlsx") 只返回xlsx文件。

转自:https://www.rousongs.com/1393.html

最后修改:2021 年 09 月 26 日
如果觉得我的文章对你有用,请随意赞赏