I wonder if someone could point me in the right direct...
I have a spreadsheet with a table that has details on product sales. The table is sorted by product number, and inlcudes 9 columns, covering such things as invoice number, product code, product description, customer name and customer city. Column H has the sales value in dollars.
What I want to do is to create a macro that will insert a sub-total sales row for each product code. The number of rows for each product will typically vary. For example, the first 6 rows might be for Product A, then the next 3 rows Product B, then the next 10 for Product F, etc.
So the idea is that when I activate the macro, it will start at the top of the table, and, based on the example above, insert a row between Product A and B and put a subtotal in Column H which will be the sum of the 6 rows above. It would then insert a row between Product B and C covering the 3 rows for product B, etc.
The Product Code is in Column B. The whole table data area, excluding titles, has the range name "Sales_Data" - not sure if this is useful.
Thanks,
MikeG
I have a spreadsheet with a table that has details on product sales. The table is sorted by product number, and inlcudes 9 columns, covering such things as invoice number, product code, product description, customer name and customer city. Column H has the sales value in dollars.
What I want to do is to create a macro that will insert a sub-total sales row for each product code. The number of rows for each product will typically vary. For example, the first 6 rows might be for Product A, then the next 3 rows Product B, then the next 10 for Product F, etc.
So the idea is that when I activate the macro, it will start at the top of the table, and, based on the example above, insert a row between Product A and B and put a subtotal in Column H which will be the sum of the 6 rows above. It would then insert a row between Product B and C covering the 3 rows for product B, etc.
The Product Code is in Column B. The whole table data area, excluding titles, has the range name "Sales_Data" - not sure if this is useful.
Thanks,
MikeG