Hi SME,
I have to pull in different files from various locations. Here's an example of the files in various locations:
FY2019 Folder
DataFile1_2019
DataFile2_2019
DataFile3_2019
SourceFile1_H1_2019
SourceFile1_H2_2019
SourceFile1_H3_2019
FY2020 Folder
DataFile1_2020
DataFile2_2020
DataFile3_2020
SourceFile1_H1_2020
SourceFile1_H2_2020
SourceFile1_H3_2020
All the DataFile* have the same structure. Same with all the SourceFile*. What I want to do is to consolidate all the DataFile* into one file. Same with all the SourceFile*.
I can do this the long way but it's rather clunky since I have a lot of files to consolidate. I'm trying to build a macro to do so, but I'm being limited by the file name. In the above case, I would have to do four macros - two for each year and within each year one for DataFile* and the other for SourceFile*.
How can I build a macro to look into the FY2019 and FY2020 folders and being able to consolidate all the DataFile* into one DataFile and all the SourceFile* into the other SourceFile?
I'm new at Macros. Appreciate your help.
Thanks,
K