spittingfire
05-20-2016, 05:26 PM
Hi All,
Looking for some help for someone to create a vba code to loop through a sheet and return data. I have attached 2 workbooks - one workbook has the test data and the other workbook is the workbook that I will like to pull the data into.
Book workbooks will be located in different folders for example forecast_test.xlsm is located in C:\test and testdata.xlsb is located in d:\test.
What I'm looking to accomplish is a macro that when run will automatically look at today's date and grab the data from forecast_test.xlsm from 7 days and 1 day ago. Copying data from forecast_test.xlsm "BS8:BX55" to testdata.xlsb "idp - lastweek B2:S49"
So for example if today is 5/20/2016 when I run the macro it will loop through forecast_test.xlsm and stop at sheet 13 (which in this case is 5/13/2016) copy the data from BS8:BX55 and paste it to testdata.xlsb "IDP- last week" into range B2:S49.
The macro will then continue to loop through forecast_test.xlsm and stop at sheet 19 (which in this case is 5/19/2016) copy the data from BS8:BX55 and paste it to testdata.xlsb "IDP- yesterday" into range B2:S49.
Both data I will like to paste as values.
So just to clarify I'm looking for two things today -7 (which is 7 days ago) and today -1 (which is yesterday)
This is beyond my current knowledge of excel vba and looking for help in creating this.
Thanks in advance for any help you can provide.
Looking for some help for someone to create a vba code to loop through a sheet and return data. I have attached 2 workbooks - one workbook has the test data and the other workbook is the workbook that I will like to pull the data into.
Book workbooks will be located in different folders for example forecast_test.xlsm is located in C:\test and testdata.xlsb is located in d:\test.
What I'm looking to accomplish is a macro that when run will automatically look at today's date and grab the data from forecast_test.xlsm from 7 days and 1 day ago. Copying data from forecast_test.xlsm "BS8:BX55" to testdata.xlsb "idp - lastweek B2:S49"
So for example if today is 5/20/2016 when I run the macro it will loop through forecast_test.xlsm and stop at sheet 13 (which in this case is 5/13/2016) copy the data from BS8:BX55 and paste it to testdata.xlsb "IDP- last week" into range B2:S49.
The macro will then continue to loop through forecast_test.xlsm and stop at sheet 19 (which in this case is 5/19/2016) copy the data from BS8:BX55 and paste it to testdata.xlsb "IDP- yesterday" into range B2:S49.
Both data I will like to paste as values.
So just to clarify I'm looking for two things today -7 (which is 7 days ago) and today -1 (which is yesterday)
This is beyond my current knowledge of excel vba and looking for help in creating this.
Thanks in advance for any help you can provide.