If your data is already sorted in branch order this should do what you want.
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Subtotal GroupBy:=1, Function:=xlSum, _
TotalList:=Array(3), Replace:=True, PageBreaks:=False, _
SummaryBelowData:=True