+ Reply to Thread
Results 1 to 5 of 5

Needing a code to be able to do running totals for multiple cells.

  1. #1
    Registered User
    Join Date
    04-30-2016
    Location
    port hardy
    MS-Off Ver
    2013
    Posts
    3

    Needing a code to be able to do running totals for multiple cells.

    Good Day,

    I am doing a daily input sheet for charges & settlements. Rather then having two sheets linked together, One with daily input (one column for each day of the month) and the other sheet linked to daily input sheet for month-to-date totals automatically updated with each new daily input.

    I have found a "worksheet_change" code which helps with one cell input to another cell running total, but I need a code for multiple cell inputs to correspond to their own individual running totals.

    here is what I found....

    Private Sub worksheet_change(ByVal Target As Range)

    If Target.Address(0, 0) <> "B15" Then Exit Sub

    With Range("C15")
    .Value = .Value + Range("B15")
    End With

    End Sub

    What this does is if I input into cell B15, cell C15 will have a running total of the inputs put into cell B15. This would be for the daily inputs. So for instance, May 1st I input $100 into cell B15 and cell C15 is $100 and on May 2 I input $200 into cell B15 and cell C15 becomes $300 for the running total.

    Since I can't have multiple worksheet_change codes within one worksheet, how can I add code or adjust the code so that my inputs for different categories will have their own corresponding running totals?

    I have attached my worksheet, I want to do a running total for each row: Rooms occupied, revenue rooms, house use rooms, complementary rooms, gst,pst,mrdt, debit,master card, visa, american express, cash and what ever running total rows I may have on the sheet.

    Thank you for your time.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Needing a code to be able to do running totals for multiple cells.

    Try something like this...

    Please Login or Register  to view this content.
    These are the input cells "B15:B21, B24:B28, B32:B38"
    The running totals are one cell to the right of the Input cell
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    04-30-2016
    Location
    port hardy
    MS-Off Ver
    2013
    Posts
    3

    Re: Needing a code to be able to do running totals for multiple cells.

    Thank you so much, with some minor adjustments, this works great. Again, thanks.

  4. #4
    Registered User
    Join Date
    04-30-2016
    Location
    port hardy
    MS-Off Ver
    2013
    Posts
    3

    Re: Needing a code to be able to do running totals for multiple cells.

    Is there any way that running totals can be done with a formula in the cell, rather than a manual input? example, the 3 taxes (MRDT,PST & GST) if I used a formula for each tax gst.... =sum(B15:B20)*.05 can this formula total be automatically updated daily in MTD column instead of a manual input?

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Needing a code to be able to do running totals for multiple cells.

    Quote Originally Posted by waxsiwalas View Post
    Is there any way that running totals can be done with a formula in the cell, rather than a manual input? example, the 3 taxes (MRDT,PST & GST) if I used a formula for each tax gst.... =sum(B15:B20)*.05 can this formula total be automatically updated daily in MTD column instead of a manual input?
    Just put the formula in MTD column C to calculate the tax on the running totals
    =sum(C15:C20)*.05

+ 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. Running Totals for Descriptive Cells
    By tz1154 in forum Excel General
    Replies: 5
    Last Post: 12-06-2012, 11:30 AM
  2. Macro to keep running totals across mutiple cells and multiple rows
    By Gixxy in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-28-2012, 05:37 PM
  3. Criteria based Running totals across multiple sheets
    By scaffdog845 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2012, 03:56 PM
  4. Running total of multiple running totals
    By ashncg in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-09-2011, 05:20 PM
  5. Totaling multiple running totals on separate sheets
    By ashncg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2011, 06:56 PM
  6. Running totals based on multiple criteria
    By smraines in forum Excel General
    Replies: 1
    Last Post: 11-02-2010, 05:10 PM
  7. Running Monthly Totals on Multiple Sheets
    By Dragunov in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-29-2007, 12:57 AM
  8. Summary of Multiple Worksheet Running Sum Totals
    By karstens in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-22-2006, 11:37 AM

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