Subtotals, Totals and GrandTotals

jimijon

New Member
Joined
Apr 7, 2002
Messages
8
How does one programatically create subtotals, totals, and then GrandTotals.

I have data that once is entered I want to create the totals. I am keying off of the fact that in column a, there will either be numbers which represent skus, or the word Subtotal, Total, Grand Total.

Does anyone have a looping construct that will automatically create the sums in those indicated rows? The logic being that Subtotals are the totals of the prices above it. The Total is the sum of the just the subtotals above it, and finally the Grand Total is the sum of all the totals.

There can be multiple totals.

A | B

123 | 12.5
234 | 23.5
345 | 25.8
Subtotal abc

344 | 12.3
365 | 23.2
Subtotal bcd
Total = YYY (abc+bcd)

456 | 23.3
989 | 12.1
Subtotal cde

567 | 34.9
890 | 17.5
Subotal def
Total xyz (cde +def)
Grand Total XYXY (all totals)

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I can't. Has to be done programatically since I am creating the spreadsheet from a setup sheet. In other words the individual sets up a set of skus and they want to create subtotals and totals. These are different for each individual. Of course once I figure out these totals I will be able to use them in other sheets too.
 
Upvote 0
Ok, if a visual basic code can be written for this type of scenario, I have the same scenario, can it be adapted easily or deleting or adding a section? I have a need for a subtotal, total system that will auto-adjust if a section is added or deleted. (Salespersons that leave and sections are combined or salespeople added in surplus and sections are added). I am trying to create something for a group of people less excel savvy.

Please help me out. I think I am getting close
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,104
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top