|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub zz()
Dim f$, p$, a, s
Application.ScreenUpdating = False
Sheet1.UsedRange.Offset(1).ClearContents
p = ThisWorkbook.Path & "\"
f = Dir(p & "*.xls")
Do While Len(f)
If f <> ThisWorkbook.Name Then
With GetObject(p & f)
a = .Sheets(1).Range("A2:G" & .Sheets(1).[a65536].End(3).Row)
s = Split(f, ".")(0)
.Close False
End With
With Sheet1
.Range("A" & .[a65536].End(3).Row + 1).Resize(UBound(a), UBound(a, 2)) = a
.Range("H" & .[h65536].End(3).Row + 1).Resize(UBound(a)) = s
End With
End If
f = Dir
Loop
Application.ScreenUpdating = True
End Sub
|
评分
-
2
查看全部评分
-
|