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(ThisWorkbook.Path & "\*.html") 只返回当前目录下xlsx文件。