下面的程序可以把你所有的文件所有的月份都一并汇总了,只需要这一个就可以了
Sub 汇总()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next
Dim arr, mybook As Workbook, mb As Workbook, msh As Worksheet
arr = Range(Cells(1, 2), Range("iv1").End(xlToLeft))
Set mb = ThisWorkbook
For Each msh In Sheets
If Right(msh.Name, 1) = "月" Then
For y = 1 To UBound(arr, 2)
Set mybook = GetObject(ThisWorkbook.Path & "/" & arr(1, y) & ".xls")
msh.Cells(3, y + 1) = mybook.Sheets(msh.Name).Cells(2, 2)
msh.Cells(4, y + 1) = mybook.Sheets(msh.Name).Cells(3, 2)
msh.Cells(5, y + 1) = mybook.Sheets(msh.Name).Cells(4, 2)
msh.Cells(7, y + 1) = mybook.Sheets(msh.Name).Cells(6, 2)
msh.Cells(8, y + 1) = mybook.Sheets(msh.Name).Cells(7, 2)
msh.Cells(9, y + 1) = mybook.Sheets(msh.Name).Cells(8, 2)
Windows(mybook.Name).Visible = True
mybook.Close True
Next y
End If
Next msh
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub