Put this macro in a new spreadsheet.
Save it in the folder
open it
Stand Back
Sub Auto_Open()
Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim i As Integer
MyPath = ActiveWorkbook.Path
MyName = ActiveWorkbook.Name
'Create an instance of the FileSystemObject
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Get the folder object
Set objFolder = objFSO.GetFolder(MyPath)
Count = 0
For Each objFile In objFolder.Files
Temp = objFile.Name
If Right(objFile.Name, 5) = ".xlsx" Then
ChDir MyPath
Workbooks.Open Filename:=objFile.Name
count = count +1
Sheets("Cat").Move After:=Workbooks(MyName).Sheets(Workbooks(MyName).Sheets.count)
ActiveSheet.Name ="Cat-" & Count
Windows(objFile.Name).Close False
End If
Next objFile
End Sub
Bookmarks