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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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