随便记录下
Sub loaddata() Excel.Application.DisplayAlerts = False Excel.Application.ScreenUpdating = False Dim path, filename, self As String Dim mainwb As Workbook path = Excel.ThisWorkbook.path & "\*.xls" self = Excel.ActiveWorkbook.Name Set mainwb = Excel.ActiveWorkbook filename = Dir(path) Do While filename <> "" If filename <> self Then Dim wb As Excel.Workbook Set wb = Excel.Workbooks.Open(Excel.ThisWorkbook.path & "\" & filename) wb.Sheets.Copy after:=mainwb.Sheets(mainwb.Sheets.Count) wb.Close End If filename = Dir Loop Excel.Application.DisplayAlerts = True Excel.Application.ScreenUpdating = True End Sub