• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to generate running total

Hello again,

I have the attached code which takes Data inputted by Users and does two things:
1) Makes a list of each entry. This part is working.
2) Supposed to take Value based on RC_Number and Add it to a running Total (in this example 'FrankSubtotal', this is where it falls apart. It continuously re saves over existing value.

For example if the User Selects RC_Number 3201 on the first pass and enters a value of $10. Cells AA2 would be filled:3201, Cells AB2 would be filled: Frank and Cells AC2 would be $10. The Cells D9 would have the Value $10.

Now on the next pass if the User selects RC_Number 3201 AGAIN and enters a value of $25. Cells AA3 would be filled:3201, Cells AB3 would be filled: Frank and Cells AC3 would be $25 (this part is working). The Cells D9 should have the Value $35. But I'm getting Cells D9 as $25.

Does anyone see my error??
 

Attachments

  • Demo.xlsm
    79.5 KB · Views: 4
Kinda Yes, kinda no. Here's what worked:
Code:
        If Me.RC_Numbers.Text = 3201 Then
            ADMGOVSubtotal = Range("D9").Value + Me.Expense.Value
            Range("D9").Value = ADMGOVSubtotal
        End If
[CODE]

And Thanks for your help! All the Excel ninjas here are great
 
Last edited:
Back
Top