ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   adding and subtracting using vb code (https://www.excelbanter.com/excel-discussion-misc-queries/108608-adding-subtracting-using-vbulletin-code.html)

ASU

adding and subtracting using vb code
 
Is there a way to use vb codes to carry out adding, subtracting and to keep a
running total on individual items on a table? below is a small part of my
table.

A B C D
Item Stock in Stock out Stock held

Nails 100 20 80
Clips 100 50 50
Clips 0 20 30
Nails 50 10 120
and so on.

Items can be added to the table. Col 'D' keeps a running total of each
separate items.

Thank you.
--
ASU

Toppers

adding and subtracting using vb code
 
If the data is as defined in your example, starting in row 3:

=SUMIF($A$3:A3,A3,$B$3:B3)-SUMIF($A$3:A3,A3,$C$3:C3)

HTH

"ASU" wrote:

Is there a way to use vb codes to carry out adding, subtracting and to keep a
running total on individual items on a table? below is a small part of my
table.

A B C D
Item Stock in Stock out Stock held

Nails 100 20 80
Clips 100 50 50
Clips 0 20 30
Nails 50 10 120
and so on.

Items can be added to the table. Col 'D' keeps a running total of each
separate items.

Thank you.
--
ASU


George

adding and subtracting using vb code
 
Thanks very much
--
George


"Toppers" wrote:

If the data is as defined in your example, starting in row 3:

=SUMIF($A$3:A3,A3,$B$3:B3)-SUMIF($A$3:A3,A3,$C$3:C3)

HTH

"ASU" wrote:

Is there a way to use vb codes to carry out adding, subtracting and to keep a
running total on individual items on a table? below is a small part of my
table.

A B C D
Item Stock in Stock out Stock held

Nails 100 20 80
Clips 100 50 50
Clips 0 20 30
Nails 50 10 120
and so on.

Items can be added to the table. Col 'D' keeps a running total of each
separate items.

Thank you.
--
ASU



All times are GMT +1. The time now is 04:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com