?
As the uploaded workbook contains 3 sheets I assume that it is the sheet "Inventory Report" that you are interested in. As this is a pivot table I have not managed to copy both pivot formats and values. So for what it's worth here is a macro for copying the values.
The line
must be changed to the folder name and hard disk where you have the excel files you are interested in.
Option Explicit
Sub ProcessAllFiles()
Dim sPath As String
Dim Wb As Workbook
Dim sFile As String
Dim i As Integer
sPath = "F:\Temp\"
sFile = Dir(sPath & "*.xls") 'changing "*.xlsx" to "*.xl??" will find all files
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Do While sFile <> ""
Set Wb = Workbooks.Open(sPath & sFile)
Sheets("Inventory Report").Activate
ActiveSheet.UsedRange.Copy
Wb.Close SaveChanges:=False
i = ActiveSheet.UsedRange.Rows.Count
If i = 1 And Range("A1") = "" Then
Range("A1").PasteSpecial Paste:=xlPasteAll
Else
Range("A" & i + 1).PasteSpecial Paste:=xlPasteAll
End If
Application.CutCopyMode = False
sFile = Dir
Loop
Columns("A:I").Columns.AutoFit
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
In order to keep the pivot format one could perhaps copy the "Inventory Report" sheet from each of the 24 excel files and paste those in a "Master file". This would give you a master file with 24 sheets, one from each file.
Alf
Bookmarks