|
多工作簿合并的:
Sub test()
Dim brr(1 To 100000, 1 To 7)
p = ThisWorkbook.Path & "\"
f = Dir(p & "*.xlsx")
Application.ScreenUpdating = False
Do While f <> ""
If f <> ThisWorkbook.Name Then
Set wb = Workbooks.Open(p & f)
Arr = wb.Sheets(1).[A1].CurrentRegion
wb.Close False
For i = 2 To UBound(Arr)
m = m + 1
For j = 1 To 7
brr(m, j) = Arr(i, j)
Next
Next
End If
f = Dir
Loop
Set wb = Nothing
With Sheet1
.Cells.ClearContents
.[A1].Resize(1, 7) = Arr
.[a2].Resize(m, 7) = brr
End With
Application.ScreenUpdating = True
MsgBox "合并完成!"
End Sub
|
评分
-
1
查看全部评分
-
|