marco help

M

mr1104839

Keep getting an error message with i try to write a marco to caculate
the subtotal of a items. say i am trying to total the number of sales a
rep has for a product. please see example below and help.
ID Product Item Sales
p1 beh 1745 20
p1 hbe 1742 5
p1 bed 125 10
p1 hbe 172 15
p2 hbe 1742 52

and so on with several defferent ID and products.......any help you
could give would be helpful.
 
G

Guest

Did you turn on the macro recorder and do it manually?

Also, you would need to sort by ID and then Product before you do it to get
the correct subtotals.
 
G

Guest

Are you trying to insert Subtotals (Data -> Subtotal) or are you trying to
write a macro to look through your data and determine some subtotals? To
insert subtotals turn on the macro recorder and just have at it. To determine
the subtotals via code I mighrt suggest using a sumproduct formula instead...
Here is a link...

http://www.xldynamic.com/source/xld.SUMPRODUCT.html
 

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