+ Reply to Thread
Results 1 to 5 of 5

Subtotal on mulitple columns with VBA

  1. #1
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Subtotal on mulitple columns with VBA

    Hi Excel Gurus!!! I have a problem where I want to apply a subtotal row and then sum or count various columns when there's a change in the Department Name, in my attached example file column C. In the attached file are two sheets, one is the original file and the other is my desired results.

    The desired results shows the subtotal line hightighted with a color to make it stand out. In the example file that goes up to column T. In the case of future changes to this file (for example I add a column based on a users request), I'd like the VBA code to 'know' to now go out to column U, the same if I were to delete a column that the coloring go upto the last cell where there's data.

    Any suggested VBA code would get great!!! Thanks all!
    Attached Files Attached Files
    Last edited by Ironman; 03-03-2014 at 11:10 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Subtotal on mulitple columns with VBA

    Have you looked at using the built-in Subtotal feature in the Data tab?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Subtotal on mulitple columns with VBA

    FDibbins - - Thanks for the quick response. Yes, I looked at that. This will be a monthly process I'm looking to automate. The first step is for me to make many formatting changes (about 15 of them), via VBA, to a file I pull out of the reporting system monthly and at times AdHoc. That part I got covered, but I can't seem to get the totals on one row and then color code the row...etc.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Subtotal on mulitple columns with VBA

    One way
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Subtotal on mulitple columns with VBA

    jindon - - thank you! works perfectly. I applied the code to a larger file and again, perfect! Thank you!

+ 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. Working with mulitple columns with the Columns property
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2013, 10:34 PM
  2. sumifs with mulitple columns and mulitple criteria in each column
    By bkaufman in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-18-2012, 05:11 PM
  3. Combo Box Mulitple Columns
    By Michael@Tafe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2010, 06:09 PM
  4. Replies: 0
    Last Post: 03-13-2006, 06:50 PM
  5. Repeating a formula across mulitple columns
    By aebjeffrey in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2006, 04:50 PM

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