V

【VBA】遍历目录

自然数 笔记 2020-11-02
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文件。
PREV
双卡手机装双卡是否拖慢网速
NEXT
【Excel】中countif函数的使用方法