ekbrowning
New Member
- Joined
- Mar 26, 2013
- Messages
- 7
Hi, I have a data table that is updated daily from an external data source. Each day, the macro overwrites the previous day's information and adds in some formatting/formualas to meet specification. This part all works very well.
Where I am stuck is the data I am getting is incomplete for all dates prior to the date the report was run in two columns. I would like the macro to copy data from one cell into another cell for all days prior to the report date. The data source does not contain a datestamp so I am thinking this can be accomplished 2 ways:
1) user inputs date of report (preferred)
2) copy data for all dates prior to today (will work most cases, but if the report is delayed, it could cause data issues).
Below is a sample of what my data looks like. Assume that Today's date is 3/26. For all dates prior to 3/26, I would like the macro to copy the data from Units sold Last Year to the Units sold last year to date. I have included different stores, but I do not want the macro to look at that as the stores can change. I am including that to illustrate how the data is organized (there are about 20,000 rows with multiple stores and segments within each store). Above, I stated that i have to do this same procedure for another set of columns, but I think i can adapt any advice to work on the other set of columns!
If anyone is able to offer assistance it would be appreciated!
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Store[/TD]
[TD]Units sold LY To Date[/TD]
[TD]Units sold LY[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/24/12[/TD]
[TD]Boston[/TD]
[TD][/TD]
[TD]108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/25/12[/TD]
[TD]Boston[/TD]
[TD][/TD]
[TD]112[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/26/12[/TD]
[TD]Boston[/TD]
[TD]82[/TD]
[TD]91[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/27/12[/TD]
[TD]Boston[/TD]
[TD]101[/TD]
[TD]121[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/24/12[/TD]
[TD]Chicago[/TD]
[TD][/TD]
[TD]52[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/25/12[/TD]
[TD]Chicago[/TD]
[TD][/TD]
[TD]85[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/26/12[/TD]
[TD]Chicago[/TD]
[TD]58[/TD]
[TD]72[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/27/12[/TD]
[TD]Chicago[/TD]
[TD]65[/TD]
[TD]90[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]and on and on[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Where I am stuck is the data I am getting is incomplete for all dates prior to the date the report was run in two columns. I would like the macro to copy data from one cell into another cell for all days prior to the report date. The data source does not contain a datestamp so I am thinking this can be accomplished 2 ways:
1) user inputs date of report (preferred)
2) copy data for all dates prior to today (will work most cases, but if the report is delayed, it could cause data issues).
Below is a sample of what my data looks like. Assume that Today's date is 3/26. For all dates prior to 3/26, I would like the macro to copy the data from Units sold Last Year to the Units sold last year to date. I have included different stores, but I do not want the macro to look at that as the stores can change. I am including that to illustrate how the data is organized (there are about 20,000 rows with multiple stores and segments within each store). Above, I stated that i have to do this same procedure for another set of columns, but I think i can adapt any advice to work on the other set of columns!
If anyone is able to offer assistance it would be appreciated!
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Store[/TD]
[TD]Units sold LY To Date[/TD]
[TD]Units sold LY[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/24/12[/TD]
[TD]Boston[/TD]
[TD][/TD]
[TD]108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/25/12[/TD]
[TD]Boston[/TD]
[TD][/TD]
[TD]112[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/26/12[/TD]
[TD]Boston[/TD]
[TD]82[/TD]
[TD]91[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/27/12[/TD]
[TD]Boston[/TD]
[TD]101[/TD]
[TD]121[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/24/12[/TD]
[TD]Chicago[/TD]
[TD][/TD]
[TD]52[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/25/12[/TD]
[TD]Chicago[/TD]
[TD][/TD]
[TD]85[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/26/12[/TD]
[TD]Chicago[/TD]
[TD]58[/TD]
[TD]72[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/27/12[/TD]
[TD]Chicago[/TD]
[TD]65[/TD]
[TD]90[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]and on and on[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]