VBA for subtotals by Company code and currency

STIRRELL

Board Regular
Joined
Dec 30, 2010
Messages
62
Office Version
  1. 365
Hi, I have tried searching for VBA code to add subtotals below each change in Company code and currency ( For example in company 30 we have GBP and PLN) so that would need to be split out.
I have the data in a pivot table and I am copying the data onto a separate spreadsheet (INTL_PIV_1) then trying to format it as below. Unfortunately, ADP must have the data in this format to upload and will not take it in the pivot table format.
Can you help with the code to add subtotals by CO ( company code) and Currency? And add bold and underline the subtotal? The range of data will change each time. The data will start in Column A to column F ( not in K like below) Oh and it looks like they add a row between each subset.

The basic data will be without the subtotals on sheet INTL_PIV_1


The macros I found would only subtotal by company and not also currency.

any help is appreciated.
Sharon
 

Attachments

  • SAMPLE.JPG
    SAMPLE.JPG
    44.3 KB · Views: 6
  • Before.JPG
    Before.JPG
    74.6 KB · Views: 7

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi, I have tried searching for VBA code to add subtotals below each change in Company code and currency ( For example in company 30 we have GBP and PLN) so that would need to be split out.
I have the data in a pivot table and I am copying the data onto a separate spreadsheet (INTL_PIV_1) then trying to format it as below. Unfortunately, ADP must have the data in this format to upload and will not take it in the pivot table format.
Can you help with the code to add subtotals by CO ( company code) and Currency? And add bold and underline the subtotal? The range of data will change each time. The data will start in Column A to column F ( not in K like below) Oh and it looks like they add a row between each subset.

The basic data will be without the subtotals on sheet INTL_PIV_1


The macros I found would only subtotal by company and not also currency.

any help is appreciated.
Sharon
I forgot to put tags I will repost
 
Upvote 0
Please do not repost this question, as per Rule#12 thanks
 
Upvote 0
There is no need to add tags. Why do you feel you need to?
 
Upvote 0

Forum statistics

Threads
1,215,436
Messages
6,124,869
Members
449,192
Latest member
MoonDancer

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