Hello All,
I want to modify this code to add a running total of column A on column B rows every time I add a value on column A. Cell B2 has already been set to a specific value. So I would like the code to start adding B2+A3 instead of A2+B2. I'm tucking this to a button.
Screen Shot 2016-04-15 at 1.09.45 PM.png
Sub Test()
Dim Coin As Long
Dim Total As Long
Dim Demand As Long
Demand = Cells(2, 3)
Total = 0
For Coin = 2 To Cells(Rows.Count, 1).End(xlUp).Row
Total = Total + Cells(Coin, 1)
If Total > Demand Then
Cells(Coin, 1).Interior.ColorIndex = 6
Total = 0
Else
Cells(Coin, 1).Interior.ColorIndex = xlNone
End If
Next Coin
End Sub
Thank you!
Bookmarks