|
Sub 数据汇总()
Application.ScreenUpdating = False
Dim arr数据
Dim s行 As Integer
Set wk汇总 = Worksheets(1)
Filename = Dir(ThisWorkbook.Path & "\*.xls")
Do While Filename <> ""
If Filename <> ThisWorkbook.Name Then
fn = ThisWorkbook.Path & "\" & Filename
Set wb = Workbooks.Open(fn)
Set Sht = wb.Worksheets(1)
j = Sht.Range("B65536").End(xlUp).Row
h末列 = Sht.UsedRange.Columns.Count
s单位 = Left(wb.Name, 4)
arr数据 = wb.Worksheets(1).Range(Cells(2, 1), Cells(j, h末列))
s行 = wk汇总.Range("B65536").End(xlUp).Row
wk汇总.Range("A" & s行 + 1).Resize(j - 1, h末列) = arr数据
wb.Close False
End If
Filename = Dir
wkcount = wkcount + 1
Loop
Application.ScreenUpdating = True
End Sub |
|