Need VBA help to copy/paste data

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.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hello !

What are the names of your worksheets ?

Where the data in each set starts (cells) ?

Thanks
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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