VBA Excel table creating 6 different levels of subtotals and one grand total

  • @Helpers


    I need to programmatically (VBA) format an Excel table creating 6 different levels of subtotals and one grand total. Each account with a code level counter higher than 6 is a level account, which implies that there can be booked no mutations on such an account.


    I managed to code the routine for the first subtotals, second subtotals and grand total, but I’m now stuck trying to figure out how to implement in the code an level code that’s starts making new subtotals after level code 3. After level code 3 should start a new level counting sections with level code 1 and level code 2 witch then should give an subtotal of these 1 sub and 2 sub when level code 3 is filled in.


    Now we have two (subtotal) amounts at level code 3, so if now the level code is 4 then the subtotal at this level should be the result of the first level subtotal 3 and the second subtotal 3. The same structure if level code 5 (result all level code with 4) and if level code is 6 (result all level code with 5).
    In attached Excel worksheet my efforts so far.
    I could not attached the Pdf with the (third party) example. If necessarily I can sent it later.
    After search for more than a week on the internet now I hope that some one can help me out with an working VBA macro.
    Thanks in advance.
    Best regards,
    Esko
    The Netherlands


    [ATTACH=JSON]{"data-align":"none","data-size":"full","title":"Example level totals.png","data-attachmentid":1200977}[/ATTACH]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!