Sub List_Files()
Dim f As Object, fso As Object
Dim folder As String
Dim wb As Workbook, ws As Worksheet
Set wb = ActiveWorkbook
Set ws = ActiveSheet
Set fso = CreateObject("Scripting.FileSystemObject")
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
If .SelectedItems.Count = 0 Then
MsgBox "Cancelled"
End
End If
folder = .SelectedItems(1)
End With
For Each f In fso.GetFolder(folder).Files
If Right(f.Name, 3) = "xls" Then
Application.Workbooks.Open f.Name
Application.DisplayAlerts = False
For Each sht In ActiveWorkbook.Sheets
sht.Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Range("A1").Select
Next
ActiveWorkbook.Close True
End If
Next
End Sub