HI
I am hoping someone can help, I have a very basic macro that opens a file, copies information from a specific tab and pastes it into a master sheet:
Workbooks.Open Filename:= _
"Filepath\Tania.xls" _
, UpdateLinks:=0
Sheets("Caseload").Select
Rows("3:20").Select
Selection.Copy
Windows("Master.xlsm").Activate
Sheets("Tania").Select
Rows("3:3").Select
ActiveSheet.Paste
Range("A3").Select
Windows("Tania.xls").Activate
Application.CutCopyMode = False
ActiveWindow.Close
Range("A4").Select
I have a folder with 10 files in, all with different names I.e. Tania, Paul, Peter, Mary etc.
I have the above macro 10 times so it opens each file in turn and copies the required data from the "Caseload" WorkSheet (this is a constant in all Workbooks) into the Master Workbook onto the corresponding matching WorkSheet.
The names of the files will occasionally change to due team changes, so I have to go in and rename the WorkSheets in the Master file and then also amend the corresponding Macro.
Is there a Macro that I can use that will "loop" the opening of each file in the folder (no matter the file name)? Copy the information from required Worksheet ("Caseload")and paste it into the Master Workbook (however, paste it onto the first Worksheet and then rename that Worksheet with the name of the file it was copied from, and then move onto the next Worksheet until all files have been actioned) (ignoring Worksheets named LMA and Summary in the Master)?
I have tried to see if this is possible from previous posts but having no luck, any help would be greatly appreciated and if any further information is required, please let me know.
Thanks
MarkAn
I am hoping someone can help, I have a very basic macro that opens a file, copies information from a specific tab and pastes it into a master sheet:
Workbooks.Open Filename:= _
"Filepath\Tania.xls" _
, UpdateLinks:=0
Sheets("Caseload").Select
Rows("3:20").Select
Selection.Copy
Windows("Master.xlsm").Activate
Sheets("Tania").Select
Rows("3:3").Select
ActiveSheet.Paste
Range("A3").Select
Windows("Tania.xls").Activate
Application.CutCopyMode = False
ActiveWindow.Close
Range("A4").Select
I have a folder with 10 files in, all with different names I.e. Tania, Paul, Peter, Mary etc.
I have the above macro 10 times so it opens each file in turn and copies the required data from the "Caseload" WorkSheet (this is a constant in all Workbooks) into the Master Workbook onto the corresponding matching WorkSheet.
The names of the files will occasionally change to due team changes, so I have to go in and rename the WorkSheets in the Master file and then also amend the corresponding Macro.
Is there a Macro that I can use that will "loop" the opening of each file in the folder (no matter the file name)? Copy the information from required Worksheet ("Caseload")and paste it into the Master Workbook (however, paste it onto the first Worksheet and then rename that Worksheet with the name of the file it was copied from, and then move onto the next Worksheet until all files have been actioned) (ignoring Worksheets named LMA and Summary in the Master)?
I have tried to see if this is possible from previous posts but having no luck, any help would be greatly appreciated and if any further information is required, please let me know.
Thanks
MarkAn