macro to copy from tabA to tabB depending on conditions

sncb

Board Regular
Joined
Mar 17, 2011
Messages
168
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi All,

Im using data from tab A where the number of records change daily(copying data from report). Every morning I copy data from a report into tab A and then I want to run a macro which will give the totals in tabB depending on the records of tabA.

Just to explain, on top is tab A and below is B.
everyday the number of records in tabA changes. eg I could have bolts and seats added to the Germany category but in the end I have to put the totals for that category under the country header in Tab B. could anyone recommend a macro code for it. Thanks in advance.
Excel Workbook
ABCD
1Germany
2
3EDCProductNcodeQty
4FDCRimsAB0
5FDCRimsAB0
6FDCRimsAB0
7FDCRimsAB0
8FDCWheelsCD160
9FDCWheelsCD0
10FDCWheelsCD250
11
12
13Italy
14
15EDCProductNcodeQty
16MDCWheelsCD100
17MDCWheelsCD540
18MDCWheelsCD0
19MDCBoltsZA0
20MDCBoltsZA400
21MDCBoltsZA200
Sheet3
Excel 2010
Excel Workbook
GHIJ
7CountryProductNcodeQty
8GermanyWheelsCD410
9GermanyBoltsZA0
10GermanyRimsRM0
11GermanySeatsSA0
12ItalyWheelsCD640
13ItalyBoltsZA600
14ItalyRimsRM0
15ItalySeatsSA0
Sheet3
Excel 2010
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
just FYi..the records under each country and for each record are separated by colour(tab A, col E) which i've not shown in the columns..
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

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