|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
常用写法:
- Public r%, Arr1()
- Sub lqxs()
- Dim Arr, myPath$, myName$, Myr&
- Application.ScreenUpdating = False
- myPath = ThisWorkbook.Path & "\提取工作簿里的工作表"
- myName = Dir(myPath & "*.xls")
- Do While myName <> ""
- With GetObject(myPath & myName)
- Arr = .Sheets(1).Range("A1").CurrentRegion
- r = r + 1
- ReDim Preserve Arr1(1 To 2, 1 To r)
- Arr1(1, r) = myName
- Arr1(2, r) = UBound(Arr)
- .Close False
- End With
- myName = Dir
- Loop
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|