gkisystems
Board Regular
- Joined
- Apr 20, 2012
- Messages
- 76
I have 3 sets of data on a single Excel worksheet. The first set of data represents a copy/paste from an outside source that shows customer sales totals. The second set of data represents the same totals, except from yesterday. The third set of data is the 2nd set stacked on top of the 1st set. I use the third set of data for a pivot table. Within this pivot table, I compare the customer sales totals from yesterday to today in order to get a 1 day change. Could you help me use VBA to automate this repetitive process?
1st set of data - represents today's data
Columns A-B are formulas that do not need to be copied over to the 2nd or 3rd set of data.
Column C is a constant called "Current" so I can label this set of data as "current" day's data.
Column D is a formula.
Columns E-S is the pasted data from today.
Column T is empty.
2nd set of data - represents yesterday's data
Copied/Pasted from the first set
Column U is a constant called "Prior" so I can label this set of data as the "prior" day's data.
Columns V-AK are just a copy/paste from Columns D-S after that data becomes 1 day old
Column AL is empty.
3rd set of data - represents the 1st and 2nd set combined to drive a pivot table
Columns AM-AS are copy/pastes from C-I and U-AA.
Column AT is a formula.
Column AU represents "Today's Totals" and copy/pastes from column S and needs a find/replace to turn empty cells into 0's.
Column AV represents "Ysterday's Totals" and copy/pastes from column AK and needs a find/replace to turn empty cells into 0's.
Additionally, If there is data in a row where AM="Prior", then AU should be set to equal $0. If AM="Current", then AV should be set to equal $0.
Note - There are some blank cells in the rows of data within column AS, so the formula in AT needs to look at AR to see how far it needs to be dragged down.
Also - while the number of columns of data never changes from day to day, the number of rows does change.
1st set of data - represents today's data
Columns A-B are formulas that do not need to be copied over to the 2nd or 3rd set of data.
Column C is a constant called "Current" so I can label this set of data as "current" day's data.
Column D is a formula.
Columns E-S is the pasted data from today.
Column T is empty.
2nd set of data - represents yesterday's data
Copied/Pasted from the first set
Column U is a constant called "Prior" so I can label this set of data as the "prior" day's data.
Columns V-AK are just a copy/paste from Columns D-S after that data becomes 1 day old
Column AL is empty.
3rd set of data - represents the 1st and 2nd set combined to drive a pivot table
Columns AM-AS are copy/pastes from C-I and U-AA.
Column AT is a formula.
Column AU represents "Today's Totals" and copy/pastes from column S and needs a find/replace to turn empty cells into 0's.
Column AV represents "Ysterday's Totals" and copy/pastes from column AK and needs a find/replace to turn empty cells into 0's.
Additionally, If there is data in a row where AM="Prior", then AU should be set to equal $0. If AM="Current", then AV should be set to equal $0.
Note - There are some blank cells in the rows of data within column AS, so the formula in AT needs to look at AR to see how far it needs to be dragged down.
Also - while the number of columns of data never changes from day to day, the number of rows does change.