Hi Guys,
Since it's my first post on this forum I wanted to thanks everyone for the tremendous amount of help I have received from reading all the threads.
I do however have one small VBA problem that I am stuck on for the past few days and could not find help by checking these boards or googling.
Here is the issue:
I have a file that contains the macro, lets call it Master_File.
In the folder with Master_File, there are ~10 subfolders, with different files within each subfolder.
Only 1 of the files within each subfolder is has a filename that ends with "final.xlsx" (for example, therey maybe 2 files inside a subfolder, "123.xlsx" and "123_final.xlsx").
I need a macro that will collect the data from each of the "final" files and consolidate into the master DB. I can handle the process of data consolidation just fine but I having huge troubles creating a macro that will search each of these folders for their specific "final".
As a small additional request. In order for me to have it a bit easier, could you please help me with setting sheet(1) of each of the final file as a variable named "okr".
Below I'm posting the simple consolidation part:
Any help would be really appreciated.
Since it's my first post on this forum I wanted to thanks everyone for the tremendous amount of help I have received from reading all the threads.
I do however have one small VBA problem that I am stuck on for the past few days and could not find help by checking these boards or googling.
Here is the issue:
I have a file that contains the macro, lets call it Master_File.
In the folder with Master_File, there are ~10 subfolders, with different files within each subfolder.
Only 1 of the files within each subfolder is has a filename that ends with "final.xlsx" (for example, therey maybe 2 files inside a subfolder, "123.xlsx" and "123_final.xlsx").
I need a macro that will collect the data from each of the "final" files and consolidate into the master DB. I can handle the process of data consolidation just fine but I having huge troubles creating a macro that will search each of these folders for their specific "final".
As a small additional request. In order for me to have it a bit easier, could you please help me with setting sheet(1) of each of the final file as a variable named "okr".
Below I'm posting the simple consolidation part:
Code:
okr.Range("A8:AV" & Cells(Rows.Count, "A").End(xlUp).Row).Copy
ost = ThisWorkbook.Sheets(1).Range("A" & Rows.Count).End(xlUp).Row
ThisWorkbook.Sheets(1).Range("A" & ost + 1).PasteSpecial xlPasteValues
Any help would be really appreciated.