Thanks for the quick replay. Unfortunately the code you posted doesn't work since it sums all the numbers listed above the cell instead of seperating and considering each categories on columns A.

Using your procedure I end up with the following with my sample file:

AAA ------1
AAA-------1
AAA-------1
AAA-------1
--------- 4
BBB ------1
BBB-------1
BBB-------1
---------11
FFF ------1
FFF-------1
FFF-------1
FFF-------1
--------- 26
XXX ------1
----------53
DDD-------1
DDD-------1
DDD-------1
----------109