Sum at point of change

  • Thread starter Thread starter Soniya
  • Start date Start date
S

Soniya

Hi all,

I have data something like this:

Amount(A)Rec(B) Sub total(C)

1000 123
1500 123
2300 123
2400 111
1300 111
1150 111
1250 105
1000 102

....
how can i code to get a subtotal at the end of each rec
in my column c?

so my data will look like

Amount(A)Rec(B) Sub Total(C)

1000 123
1500 123
2300 123 4800
2400 111
1300 111
1150 111 4850
1250 105 1250
1000 102 1000

TIA

Soniya
 
Soniya,

Why not create a pivot table, using column B as your row and column A as the
data item.

Cheers
Nigel
 
Soniya, how about a subtotal below each one? Look at subtotals in help

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
One way:
Dim tmpCell As Range, x As Long
For Each tmpCell In Range("B2:B9")
x = x + tmpCell(1, 0).Value
If tmpCell(2).Value <> tmpCell(1).Value Then
tmpCell(1, 2).Value = x
x = 0
End If
Next tmpCell
--
Hope this helps,
James dot Becker at NCR dot com
~
~
~
:wq!
 
Back
Top