Hi to all of you, kindly require to provide me support for a VBA code so that, to prepare “Sub Totals” per year base on Col. “A” but starting from “A13” till last completed row. I present below the original data and expected result. Thank you all in advance
Original
A | B | C | D | |
1 | Date | Sale | Cost of Sale | Gross Profit |
13 | 15/01/2017 | 1,000 | 500 | 500 |
14 | 22/01/2017 | 1,250 | 850 | 400 |
15 | 29/01/2017 | 1,150 | 630 | 520 |
16 | 05/02/2017 | 1,283 | 615 | 668 |
17 | 12/02/2017 | 1,358 | 680 | 678 |
18 | 19/02/2017 | 1,433 | 693 | 741 |
19 | 02/03/2017 | 1,508 | 705 | 803 |
20 | 28/03/2017 | 1,583 | 718 | 866 |
21 | 12/03/2017 | 1,658 | 730 | 928 |
22 | 19/03/2017 | 1,733 | 743 | 991 |
23 | 26/03/2017 | 1,808 | 755 | 1,053 |
24 | 02/04/2017 | 1,883 | 768 | 1,116 |
25 | 09/04/2017 | 1,958 | 780 | 1,178 |
26 | 16/04/2017 | 2,033 | 793 | 1,241 |
27 | 23/04/2017 | 2,108 | 805 | 1,303 |
28 | 30/04/2017 | 2,183 | 818 | 1,366 |
29 | 09/01/2018 | 1,650 | 750 | 900 |
30 | 15/01/2018 | 1,345 | 733 | 612 |
31 | 31/01/2018 | 1,110 | 730 | 380 |
32 | 02/02/2018 | 1,254 | 655 | 599 |
33 | 17/02/2018 | 1,358 | 695 | 663 |
34 | 25/02/2018 | 1,524 | 705 | 819 |
35 | 26/02/2018 | 1,647 | 752 | 895 |
36 | 01/03/2018 | 1,487 | 745 | 742 |
37 | 10/03/2018 | 1,752 | 710 | 1,042 |
38 | 25/03/2018 | 1,625 | 769 | 856 |
39 | 27/03/2018 | 1,910 | 699 | 1,211 |
40 | 31/03/2018 | 1,745 | 712 | 1,033 |
41 | 05/04/2018 | 2,020 | 847 | 1,173 |
42 | 15/04/2018 | 1,780 | 762 | 1,018 |
43 | 25/04/2018 | 1,899 | 812 | 1,087 |
44 | 29/04/2018 | 1,905 | 955 | 950 |
<colgroup><col style="mso-width-source:userset;mso-width-alt:853;width:18pt" width="24"> <col style="mso-width-source:userset;mso-width-alt:3953;width:83pt" width="111"> <col style="mso-width-source:userset;mso-width-alt:2702;width:57pt" width="76"> <col style="mso-width-source:userset;mso-width-alt:3441;width:73pt" width="97"> <col style="mso-width-source:userset;mso-width-alt:3413;width:72pt" width="96"> </colgroup><tbody>
</tbody>
Expected result
A | B | C | D | |
1 | Date | Sale | Cost of Sale | Gross Profit |
13 | 15/01/2017 | 1,000 | 500 | 500 |
14 | 22/01/2017 | 1,250 | 850 | 400 |
15 | 29/01/2017 | 1,150 | 630 | 520 |
16 | 05/02/2017 | 1,283 | 615 | 668 |
17 | 12/02/2017 | 1,358 | 680 | 678 |
18 | 19/02/2017 | 1,433 | 693 | 741 |
19 | 02/03/2017 | 1,508 | 705 | 803 |
20 | 28/03/2017 | 1,583 | 718 | 866 |
21 | 12/03/2017 | 1,658 | 730 | 928 |
22 | 19/03/2017 | 1,733 | 743 | 991 |
23 | 26/03/2017 | 1,808 | 755 | 1,053 |
24 | 02/04/2017 | 1,883 | 768 | 1,116 |
25 | 09/04/2017 | 1,958 | 780 | 1,178 |
26 | 16/04/2017 | 2,033 | 793 | 1,241 |
27 | 23/04/2017 | 2,108 | 805 | 1,303 |
28 | 30/04/2017 | 2,183 | 818 | 1,366 |
29 | 2017-Total | 25,933 | 11,580 | 14,353 |
30 | 09/01/2018 | 1,650 | 750 | 900 |
31 | 15/01/2018 | 1,345 | 733 | 612 |
32 | 31/01/2018 | 1,110 | 730 | 380 |
33 | 02/02/2018 | 1,254 | 655 | 599 |
34 | 17/02/2018 | 1,358 | 695 | 663 |
35 | 25/02/2018 | 1,524 | 705 | 819 |
36 | 26/02/2018 | 1,647 | 752 | 895 |
37 | 01/03/2018 | 1,487 | 745 | 742 |
38 | 10/03/2018 | 1,752 | 710 | 1,042 |
39 | 25/03/2018 | 1,625 | 769 | 856 |
40 | 27/03/2018 | 1,910 | 699 | 1,211 |
41 | 31/03/2018 | 1,745 | 712 | 1,033 |
42 | 05/04/2018 | 2,020 | 847 | 1,173 |
43 | 15/04/2018 | 1,780 | 762 | 1,018 |
44 | 25/04/2018 | 1,899 | 812 | 1,087 |
45 | 29/04/2018 | 1,905 | 955 | 950 |
46 | 2018-Total | 26,011 | 12,031 | 13,980 |
47 | Grand Total | 51,945 | 23,611 | 28,334 |
<colgroup><col style="mso-width-source:userset;mso-width-alt:1024;width:22pt" width="29"> <col style="mso-width-source:userset;mso-width-alt:5176;width:109pt" width="146"> <col style="mso-width-source:userset;mso-width-alt:5262; width:111pt" width="148" span="3"> </colgroup><tbody>
</tbody>