I need some VBA code to calculate the subtotals for each group in Column A that has a $$balance in column F but with the subtotals 3 rows below the colum total. There is a variable number of groups in Column A- can be up to twenty different group
Total $204,347.21
Group 1 total: $103854.21
Group 2 total: $92358.52
Group 3 total: $5409.29 Book1.xls
Unfortunately not quite what I needed . The table can not be broken up into subtotals and the results of subtotaling each group can only show up below the totals
Not clear what you mean by "lengths". If you mean that the number of data rows may increase or decrease, then you could modify the SUMIF formula to start at the heading row and end at the Total row. If that is done, then the formulas for the group totals will expand and contract as rows are added/deleted. See revised example file. Book1.xls
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
Enclosed is your workbook and code where before shows you your data before macro is run and after is once the macro is run..
Saurabh..
Open in new window