Hello all,
I have a small code that opens the files in a folder, after asking me when the names should contains.
Now, since the files are opened, i need to loop through every file and copy every page and paste it into this workbook. (creating new sheets for every opened file that is imported).
If you think that could be another solution, please help.
Thank you in advance.
I have a small code that opens the files in a folder, after asking me when the names should contains.
Code:
Sub OpenFiles()
Dim MyFolder As String
Dim MyFile As String
Dim MyName As String
MyFolder = "C:\Users\xxx\Desktop\New folder\"
MyName = InputBox("Please enter name to search for:")
MyFile = Dir(MyFolder & "\*" & MyName & "*.xls")
Do Until MyFile = ""
Workbooks.Open Filename:=MyFolder & "" & MyFile
MyFile = Dir
Loop
End Sub
Now, since the files are opened, i need to loop through every file and copy every page and paste it into this workbook. (creating new sheets for every opened file that is imported).
If you think that could be another solution, please help.
Thank you in advance.