Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 21st, 2007, 05:56 PM
Authorized User
 
Join Date: Jul 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Subtotals

Having trouble running two levels of subtotals in sequence - It's not giving me a error on run time, but rather not grouping the subtotals correctly?? Anyhelp would be appreciated.



'----------------------------

Private Sub CmdDiv_Click()

DistributionDiv

DistributionRgn

End Sub





'----------------------------

Sub DistributionDiv()

Worksheets("Final").Range("E11").Select

    Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(6, 7, 9, 10, _

        12, 13, 15, 16, 18, 19, 21, 22, 24, 25, 27, 28, 30, 31, 33, 34, 36, 37, 39, 40, _

        42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, _

        72, 73, 75, 76, 78, 79, 81, 82, 84, 85, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, _

        98, 99, 100, 101, 102, 103, 104, 105, 106, 107), Replace:= _

        False, PageBreaks:=False, SummaryBelowData:=True



End Sub



'--------------------------

Sub DistributionRgn()

Worksheets("Final").Range("E11").Select

    Selection.Subtotal GroupBy:=4, Function:=xlSum, TotalList:=Array(6, 7, 9, 10, _

        12, 13, 15, 16, 18, 19, 21, 22, 24, 25, 27, 28, 30, 31, 33, 34, 36, 37, 39, 40, _

        42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, _

        72, 73, 75, 76, 78, 79, 81, 82, 84, 85, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, _

        98, 99, 100, 101, 102, 103, 104, 105, 106, 107), Replace:= _

        False, PageBreaks:=False, SummaryBelowData:=True

End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating Subtotals and Totals in asp page bootsy Classic ASP Basics 3 May 13th, 2008 09:33 AM
Pivot Subtotals in Bold paul20091968 Excel VBA 0 June 29th, 2006 07:03 AM
Subtotals in access report using vba bogaerts Pro Visual Basic 2005 0 January 30th, 2006 08:33 AM
how do I show subtotals in an accessreport by vba bogaerts Pro Visual Basic 2005 0 January 30th, 2006 08:32 AM
Dividing Subtotals on a Report Corey Access 12 September 30th, 2005 11:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.