spittingfire
05-30-2016, 06:50 PM
Hi All,
I'm in search of some modifications to a code that was given to by mdmackillop - below is the url to the solution that was provided to me.
http://www.vbaexpress.com/forum/showthread.php?56112-vba-to-loop-through-multiple-worksheets-and-paste-specific-data-based-on-a-date
The situation now is that the data file has now changed from an xlsb extension to a csv extension.
The other thing that has changed is the layout of the data however it may be easier to work with.
What I need is data copied from the csv data file from 7 days ago (today -7) and also the previous day (today -1).
For example if today is May 30th I will like the data copied from May 23rd (g2:x49) and pasted into the forecast_test.xlsm sheet in the "IDP- last week" sheet "B2:S49".
Then I will like it to do the say for May 29th (previous day) and in this case (g290:x337) to forecast_test.xlsm sheet in the "IDP- yesterday" sheet "B2:S49".
What I've learnt is that every day a new file with the same file name is generated and the very first day on the top of the file will be 7 days ago which means that the location of the previous day will also be static as well, however maybe it may be best if you can make use of the date "START_TIME" in column C.
In this case the file name is a static name and will be over-written daily.
Any help will be appreciated.
Thanks
I'm in search of some modifications to a code that was given to by mdmackillop - below is the url to the solution that was provided to me.
http://www.vbaexpress.com/forum/showthread.php?56112-vba-to-loop-through-multiple-worksheets-and-paste-specific-data-based-on-a-date
The situation now is that the data file has now changed from an xlsb extension to a csv extension.
The other thing that has changed is the layout of the data however it may be easier to work with.
What I need is data copied from the csv data file from 7 days ago (today -7) and also the previous day (today -1).
For example if today is May 30th I will like the data copied from May 23rd (g2:x49) and pasted into the forecast_test.xlsm sheet in the "IDP- last week" sheet "B2:S49".
Then I will like it to do the say for May 29th (previous day) and in this case (g290:x337) to forecast_test.xlsm sheet in the "IDP- yesterday" sheet "B2:S49".
What I've learnt is that every day a new file with the same file name is generated and the very first day on the top of the file will be 7 days ago which means that the location of the previous day will also be static as well, however maybe it may be best if you can make use of the date "START_TIME" in column C.
In this case the file name is a static name and will be over-written daily.
Any help will be appreciated.
Thanks