It does not do what you ask for, it does not hide columns, but who knows, you might be happy after all
Make sure to change all references where required. The workbook with the code needs to be saved in the same folder as the other workbooks.
Have a "dummy" folder to try it on and come back to let us know what needs tweaking/changing.
Sub Get_Info()
Dim sPath As String
Dim sFil As String
Dim owb As Workbook
Dim twb As Workbook
Dim ch
Dim j As Long, a As Long
With Application
.Calculation = xlCalculationManual
.EnableEvents = False
.ScreenUpdating = False
End With
ch = Array("Header 1", "Header 2", "Header 3", "Header 4", "Header 5")
Set twb = ThisWorkbook
sPath = "C:\Which_Ever_Folder_Here\"
sFil = Dir(sPath & "*.xl*")
Do While sFil <> "" And sFil <> twb.Name
Set owb = Workbooks.Open(sPath & sFil)
With owb.Sheets("data")
For j = LBound(ch) To UBound(ch)
a = .Rows(1).Find(ch(j), , , 1).Column
.Range(.Cells(2, a), .Cells(.Cells(.Rows.Count, a).End(xlUp).Row, a)).Copy twb.Sheets("report").Cells(Rows.Count, j + 1).End(xlUp).Offset(1)
Next j
End With
owb.Close False 'Close no save
sFil = Dir
Loop
With Application
.Calculation = xlAutomatic
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
Bookmarks