+ Reply to Thread
Results 1 to 3 of 3

Subtotals

  1. #1
    Forum Contributor
    Join Date
    10-23-2003
    Posts
    141

    Subtotals

    Hi,

    Does anyone have any suggestions for the following:

    I am trying to subtotal by account & then division. My code works fine except the last division subtotal is below the account total. My code is as follows:

    Range("A1").Select
    Application.CutCopyMode = False
    Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(7, 8, 9), _
    Replace:=True, PageBreaks:=False, SummaryBelowData:=True
    Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(7, 8, 9), _
    Replace:=True, PageBreaks:=False, SummaryBelowData:=True
    Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(7, 8, 9), _
    Replace:=False, PageBreaks:=False, SummaryBelowData:=True

    Here is an example of the result (I would like the 2090 total above the 62973 total)
    Division Account
    40 0005 0 12144 62973
    0005 Total
    40 0641 0 13051 62973
    0641 Total
    40 2090 0 11878 62973
    62973 Total
    2090 Total


    Any help would be greatly appreciated!!

  2. #2
    Dave Peterson
    Guest

    Re: Subtotals

    Maybe...

    Multilevel subtotals are in the wrong position in Excel 2002 and in Excel 2003
    http://support.microsoft.com/default...b;en-us;831824



    STEVEB wrote:
    >
    > Hi,
    >
    > Does anyone have any suggestions for the following:
    >
    > I am trying to subtotal by account & then division. My code works fine
    > except the last division subtotal is below the account total. My code
    > is as follows:
    >
    > Range("A1").Select
    > Application.CutCopyMode = False
    > Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(7, 8,
    > 9), _
    > Replace:=True, PageBreaks:=False, SummaryBelowData:=True
    > Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(7, 8,
    > 9), _
    > Replace:=True, PageBreaks:=False, SummaryBelowData:=True
    > Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(7, 8,
    > 9), _
    > Replace:=False, PageBreaks:=False, SummaryBelowData:=True
    >
    > Here is an example of the result (I would like the 2090 total above the
    > 62973 total)
    > Division Account
    > 40 0005 0 12144 62973
    > 0005 Total
    > 40 0641 0 13051 62973
    > 0641 Total
    > 40 2090 0 11878 62973
    > 62973 Total
    > 2090 Total
    >
    > Any help would be greatly appreciated!!
    >
    > --
    > STEVEB
    > ------------------------------------------------------------------------
    > STEVEB's Profile: http://www.excelforum.com/member.php...fo&userid=1872
    > View this thread: http://www.excelforum.com/showthread...hreadid=497638


    --

    Dave Peterson

  3. #3
    Forum Contributor
    Join Date
    10-23-2003
    Posts
    141
    Thanks Dave, I appreciate your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1