+ Reply to Thread
Results 1 to 7 of 7

subtotal for many columns

  1. #1
    Registered User
    Join Date
    03-16-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    4

    subtotal for many columns

    Hi everyone,

    I have a table with 3400 columns, and i need to subtotal my database. If I use the subtotal function, I would have to select all the 3400 columns manually. However, also the VBA code that I found should contains the numbers from 2 until 3400 under the TotalList...

    Please Login or Register  to view this content.
    Somebody has any idea? The number of rows in the subtotal are not the same for each subtotal

    Many thanks!
    Last edited by Chimborasso; 10-22-2015 at 03:42 PM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: subtotal for many columns

    This
    Please Login or Register  to view this content.
    is not for rows. It is for columns!.

    Somehow I do not believe you plan to do separate subtotal for change in each column between B (column2) and column DZT (column3400)

    Rows are included in the part:
    Please Login or Register  to view this content.
    PS. Please edit the post and use code tags, as required by: http://www.excelforum.com/forum-rule...rum-rules.html (also described there how-to)
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    03-16-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: subtotal for many columns

    Yes, sorry, it was my mistake. I meant it for columns of course. Post is edited.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: subtotal for many columns

    Wow, that is something.
    Almost for sure standard approach will not be appropriate. Can you attach sample file with subset of desensitized data?

  5. #5
    Registered User
    Join Date
    03-16-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: subtotal for many columns

    Yes, I attached it! Thanks!
    Attached Files Attached Files

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: subtotal for many columns

    OK, reference for Range.Subtotal https://msdn.microsoft.com/en-us/library/bb238221.aspx defines

    TotalList Required Variant An array of 1-based field offsets, indicating the fields to which the subtotals are added.

    so let's create it:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-16-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: subtotal for many columns

    Thank you, it works perfectly!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Subtotal help for dynamic columns!
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-31-2015, 04:05 AM
  2. Subtotal / Count Over Many Columns
    By uberathlete in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-13-2014, 02:38 PM
  3. [SOLVED] Subtotal on mulitple columns with VBA
    By Ironman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2014, 11:03 AM
  4. Subtotal - Delete zero Subtotal and prior rows that calculate to that zero Subtotal
    By Whatsherface in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2012, 08:37 PM
  5. Subtotal for many columns
    By cube00 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2008, 03:47 PM
  6. Subtotal multiple columns
    By jbilby@valornet.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2006, 03:30 PM
  7. [SOLVED] Subtotal by two columns at once
    By Katherine in forum Excel General
    Replies: 1
    Last Post: 01-20-2005, 05:06 PM

Tags for this Thread

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