Hello,
I get 4 Excel files at 3am each morning (Mon-Fri and not weekend) saved in a drive through SFTP. If today is the 2nd of Feb for example, the latest saved version will always be as of previous work day so 1st of Feb in this example.
I have a Master workbook that I want to extract certain data from each of the 4 overnight files. The daily overnight files have a constant filename except that the date tag attached to them will change each day and will be as of yesterdays close date.
File1. Prices_mmddyyyy.xls
File2. Returns_mmddyyyy.xlsx
File3. Performance_mmddyyyy.xlsx
File4. Stats_mmddyyyy.xlsx
I need a code that will go to the folder where these overnight files are saved and in the most recently received/saved version of each of the 4 files do the following in the Master file;
1a. In cell H18 of active worksheet of Master file, open up the latest File1 and in the USD worksheet, go to the very last row and extract the figure from column C
1b. In cell I18 of active worksheet of Master file, open up the latest File1 and in the USD worksheet, go to the very last row and extract the figure from column D
2a. In cell H19 of active worksheet of Master file, open up the latest File2 and in the GBP worksheet, go to the very last row and extract the figure from column C
2b. In cell I19 of active worksheet of Master file, open up the latest File2 and in the GBP worksheet, go to the very last row and extract the figure from column D
3a. In cell H20 of active worksheet of Master file, open up the latest File3 and in the EUR worksheet, go to the very last row and extract the figure from column C
3b. In cell I20 of active worksheet of Master file, open up the latest File3 and in the EUR worksheet, go to the very last row and extract the figure from column D
4a. In cell H21 of active worksheet of Master file, open up the latest File4 and in the AUD worksheet, go to the very last column and extract the figure from row 8
4b. In cell I21 of active worksheet of Master file, open up the latest File4 and in the AUD worksheet, go to the very last column and extract the figure from row 11
Finally (if the code needs to open these overnight files first), close the overnight files without saving.
This process of extracting the above 8 datapoints into the Master file will be repeated each day so a code will be a huge time save.
Thanks in advance.
Dedu
I get 4 Excel files at 3am each morning (Mon-Fri and not weekend) saved in a drive through SFTP. If today is the 2nd of Feb for example, the latest saved version will always be as of previous work day so 1st of Feb in this example.
I have a Master workbook that I want to extract certain data from each of the 4 overnight files. The daily overnight files have a constant filename except that the date tag attached to them will change each day and will be as of yesterdays close date.
File1. Prices_mmddyyyy.xls
File2. Returns_mmddyyyy.xlsx
File3. Performance_mmddyyyy.xlsx
File4. Stats_mmddyyyy.xlsx
I need a code that will go to the folder where these overnight files are saved and in the most recently received/saved version of each of the 4 files do the following in the Master file;
1a. In cell H18 of active worksheet of Master file, open up the latest File1 and in the USD worksheet, go to the very last row and extract the figure from column C
1b. In cell I18 of active worksheet of Master file, open up the latest File1 and in the USD worksheet, go to the very last row and extract the figure from column D
2a. In cell H19 of active worksheet of Master file, open up the latest File2 and in the GBP worksheet, go to the very last row and extract the figure from column C
2b. In cell I19 of active worksheet of Master file, open up the latest File2 and in the GBP worksheet, go to the very last row and extract the figure from column D
3a. In cell H20 of active worksheet of Master file, open up the latest File3 and in the EUR worksheet, go to the very last row and extract the figure from column C
3b. In cell I20 of active worksheet of Master file, open up the latest File3 and in the EUR worksheet, go to the very last row and extract the figure from column D
4a. In cell H21 of active worksheet of Master file, open up the latest File4 and in the AUD worksheet, go to the very last column and extract the figure from row 8
4b. In cell I21 of active worksheet of Master file, open up the latest File4 and in the AUD worksheet, go to the very last column and extract the figure from row 11
Finally (if the code needs to open these overnight files first), close the overnight files without saving.
This process of extracting the above 8 datapoints into the Master file will be repeated each day so a code will be a huge time save.
Thanks in advance.
Dedu