I need a ‘looping’ macro (relative) that sums cell values based on adjacent cell contents.
With the cursor on cell B4, for instance, start the macro.
It sets the contents of C4 as the compare-with variable, and sums the values of D4 through Dr, where r is the last row where Cr contents equal the compare-with variable, and the sum appears on B4.
At that point, it looks at Cr+1, and if not empty, replaces the ‘compare-with’ variable its contents. It now sums the values of Dr+1y through Dr+1y, where y is the last row where the contents of Cr+1y are the same as the newer compare-with variable, and the sum appears on Br+1.
Repeats until there are no values.
BTW, the list is sorted by the values in column C, so the compare-with values are grouped.
Please let me know if I can add anything to my explanation.
Thx!
Nando
Bookmarks