![]() |
Sum at point of change
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 |
Sum at point of change
Soniya,
Why not create a pivot table, using column B as your row and column A as the data item. Cheers Nigel "Soniya" wrote in message ... 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 ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
Sum at point of change
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 ** "Soniya" wrote in message ... 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 |
Sum at point of change
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! "Soniya" wrote in message ... 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 |
All times are GMT +1. The time now is 02:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com