办公软件学习技巧:excel VBA基本操作:遍历当前文件夹下的excel文件

2023-04-02 15:53:14   文档大全网     [ 字体: ] [ 阅读: ]

#文档大全网# 导语】以下是®文档大全网的小编为您整理的《办公软件学习技巧:excel VBA基本操作:遍历当前文件夹下的excel文件》,欢迎阅读!
遍历,excel,基本操作,办公软件,文件夹
excel VBA基本操作:遍历当前文件夹下的

excel文件

常常用到excel以下是遍历当前文件夹下的excel表。

Sub bl() Dim myPath As String, myFile As String Dim i As Integer Dim Arr() As String i 0 myPath ThisWorkbook.Path *.xls* myFile Dir(myPath) If myFile ThisWorkbook.Name Then 假如不是本文件取出放入数组2021228日修改 ReDim Preserve Ar(i) 不清空数组 Ar(i) myFile i i 1 End If Do While myFile myFile Dir If myFile Then Exit Do End If ReDim Preserve Ar(i) 不清空数组 Ar(i) myFile i

i 1 Loop MsgBox i excel文件 End sub

1


本文来源:https://www.wddqxz.cn/fc3c28b0d3d233d4b14e852458fb770bf78a3bb0.html

相关推荐