Copy&paste from one cell to another for all entries prior to a specific Date

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]
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top