macro to automatically sum a column based on another

C

childofthe1980s

Hello:

I have a spreadsheet that, among other columns, has an inventory item column
and a quantity column.

The inventory item column has several records with item A, item B, item C,
etc. The number of items column has several records also with 8 for A in one
record, 2 for A in another record, 3 for A in another record, 4 for B in
another record, 5 for B in another record, 9 for C in another record, 7 for C
in another record, etc.

I want to create a macro that automatically sums the quantity of each item
A, B, and C. I'm not concerned with a total quantity for the entire
spreadsheet--just a total for each item.

How do I program Excel to have such a macro? I'm sure that the solution is
simple. I'm just not familiar with creating Excel macros.

Thanks!

childofthe1980s
 
M

Mark Ivey

You might be able to use the SUMIF worksheet function in your code to
accomplish that task...

Mark
 
C

childofthe1980s

Actually, no. You use Data...Subtotals. Very easy.

Thanks for the input, just the same.

childofthe1980s
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top