+ Reply to Thread
Results 1 to 2 of 2

VBA Subtotals with Variable Rows and Sections

  1. #1
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    VBA Subtotals with Variable Rows and Sections

    I'm automating a customer statement and need some help with formatting subsections. I have two code sets that each gets me almost there. Which one do you think is better, and can it be tweaked to do what I'm needing?


    This first one (Macro2 in Sample File) does exactly what I want it to do, but only for a fixed number of rows. If I have extra rows it gets caught up on syntax. Can this code be adjusted to go to LastRow?

    Also, it adds rows at the top, and I'd like it to not do that.

    Please Login or Register  to view this content.

    This second one (Macro1 in Sample file) accounts for the variable rows, and doesn't add rows at the top. But I'd need it to add two blank rows under each subtotal, and I need subtotals for each column from I to LastColumn.


    Please Login or Register  to view this content.


    Thanks!!
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA Subtotals with Variable Rows and Sections

    Hi phelbin

    Try this
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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. Column Subtotals with Variable Sections
    By phelbin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-11-2015, 07:06 AM
  2. Trying to find a way to calculate subtotals for different sections data validation
    By excerbated123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-04-2015, 01:54 AM
  3. [SOLVED] Macro to sort variable rows of data by a column in multiple sections
    By mannuhs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2013, 03:22 PM
  4. Adding variable percentages to sections of a large database.
    By JohnDoh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2013, 06:24 PM
  5. Create sections of rows
    By geamer in forum Excel General
    Replies: 1
    Last Post: 08-03-2011, 10:57 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