patsdavixen
New Member
- Joined
- Mar 5, 2013
- Messages
- 32
Hi,
I have a folder with the path "C:\A\Consolidated".
This folder contains the master file. There are also folders within the Consolidated Folder that are differentiated by dates - YYYYMMDD.
The date folders contain identical workbooks that are differentiated only by employee name. The number of employee workbooks in each date folder may vary in number because the employee may not update their workbook on a daily basis but the master file needs to be consolidated on a daily basis.
I would like to create a macro that opens the master file and then asks the user which date they want to consolidate. Based on the user’s response, the path will become "C:\A\Consolidated\YYYYMMDD”.
The macro should then proceed to open each employee workbook in the date folder and copy data from the sheet entitled “Individual” from A:AI (rows are variable but will always start with row 2) and paste the data in the master file on the sheet entitled “Consolidated” at the end of variable rows (A:AI is constant but the rows will be variable and may not start at row 2).
Once this is done the macro should close the employee workbook and continue to copy and paste from the remaining employee workbooks in loop until all workbooks have been consolidated in to the master file.
The master file must then be saved in "C:\A\Consolidated" with the new date of the file.
Could someone please help me with this as the number of workbooks to loop through are variable and the names are variable? Also the path to the employee workbooks are variable.
Thank you,
Pat
I have a folder with the path "C:\A\Consolidated".
This folder contains the master file. There are also folders within the Consolidated Folder that are differentiated by dates - YYYYMMDD.
The date folders contain identical workbooks that are differentiated only by employee name. The number of employee workbooks in each date folder may vary in number because the employee may not update their workbook on a daily basis but the master file needs to be consolidated on a daily basis.
I would like to create a macro that opens the master file and then asks the user which date they want to consolidate. Based on the user’s response, the path will become "C:\A\Consolidated\YYYYMMDD”.
The macro should then proceed to open each employee workbook in the date folder and copy data from the sheet entitled “Individual” from A:AI (rows are variable but will always start with row 2) and paste the data in the master file on the sheet entitled “Consolidated” at the end of variable rows (A:AI is constant but the rows will be variable and may not start at row 2).
Once this is done the macro should close the employee workbook and continue to copy and paste from the remaining employee workbooks in loop until all workbooks have been consolidated in to the master file.
The master file must then be saved in "C:\A\Consolidated" with the new date of the file.
Could someone please help me with this as the number of workbooks to loop through are variable and the names are variable? Also the path to the employee workbooks are variable.
Thank you,
Pat