Results 1 to 5 of 5

Subtotal according to changing number of columns

Threaded View

  1. #1
    Registered User
    Join Date
    02-19-2004
    Posts
    57

    Subtotal according to changing number of columns

    Hi I need help with the subtotal code:

    Please see attached image to understand how my table will look like for a full year.

    I need to produce YTD tables where not all months will be included.
    For Jan YTD, my code will look like this:
    Range("A3").Subtotal GroupBy:=1, Function:=xlSum, _
    TotalList:=Array(3, 4), Replace:=True, _
    PageBreaks:=False, SummaryBelowData:=True
    For Jun YTD, my code will look like this:
    Range("A3").Subtotal GroupBy:=1, Function:=xlSum, _
    TotalList:=Array(3, 4, 5, 6, 7, 8, 9), Replace:=True, _
    PageBreaks:=False, SummaryBelowData:=True
    and for Dec YTD, my code will look like this:
    Range("A3").Subtotal GroupBy:=1, Function:=xlSum, _
    TotalList:=Array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), _
    Replace:=True, PageBreaks:=False, SummaryBelowData:=True
    How can i automate this instead of changing the array every month?
    Any help is greatly appreciated!
    Attached Images Attached Images
    Last edited by josnah; 01-13-2008 at 01:20 AM.

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