Sub 遍历获取文件夹的文件地址()
Dim ferP, fp As String 'FolderPath,FilePath
Dim i As Long
Dim fpA() 'filePathArray
ferP = ThisWorkbook.path '定义 ferP = 当前文件所在文件夹
i = 0
fp = Dir(ferP & "\*.*")
Do While fp <> ""
If fp <> ActiveWorkbook.Name Then 'fp 不是当前文件
i = i + 1
ReDim Preserve fpA(1 To i)
fpA(i) = ferP & "\" & fp
End If
fp = Dir
Loop
End Sub
Dir 遍历获取文件夹中的文件地址
最新推荐文章于 2023-07-28 10:38:16 发布