Results 1 to 10 of 11

Thread: Add SubTotals To Data Table Based On Date

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    I would recommend you use subtotals instead of individually placing formulas. And a conditional format can be used to give the colors. Check the attachment.

    So I've selected the table from Column B to H starting from the first row after the headers. And used the formula RIGHT($B4,5) = "Total", and gave the required conditional format I needed. And then just used a very simple line of code

    Code:
    Sub SubTotalize()
    
        Range("B3:H" & Cells(Rows.Count, 2).End(xlUp).Row).Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(2, 3, 6), Replace:=True, PageBreaks:=False, SummaryBelowData:=True
        
    End Sub
    This will easily club your daily totals and sum it up using subtotals.
    Attached Files Attached Files
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Replies: 3
    Last Post: 07-25-2013, 01:35 PM
  2. Conditional Insert Query Based on Data in Target Table
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 06-23-2013, 04:24 PM
  3. Calculating Subtotals Within Groups of Data Using UNION
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 1
    Last Post: 05-24-2013, 11:54 AM
  4. Replies: 4
    Last Post: 05-01-2013, 09:49 PM
  5. automatic Add date in cells
    By Ryan_Bernal in forum Excel Help
    Replies: 1
    Last Post: 01-23-2013, 02:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •