>>871
まぁ、本来は>>872さんの仰る通りなんだけど、
コード書いてみたかったから書きました。

A列に名前がある行を先頭にして、B列で空白が出てきた行までの範囲の
C列の値を集計して、先頭行のD列に書き込むマクロです。
処理対象シートの下の方から順次処理をして、先頭行のD列が空白ではない時点、
もしくは先頭行が1行目になった時点で処理を終了します。

なお、With 〜 のところで処理するシートを指定しているので、
使用する際はここを適宜書き換えてください。

Sub test()
Dim rwA As Long
Dim rwB As Long
With ThisWorkbook.Sheets(1)
rwA = .Cells(.Rows.Count, 1).End(xlUp).Row
If .Cells(rwA, 1) = "" Then Exit Sub
rwB = .Cells(rwA, 2).End(xlDown).Row
Do
If .Cells(rwA, 4) = "" Then Exit Do
.Cells(rwA, 4) = WorksheetFunction.Sum(.Cells(rwA, 3).Resize(rwB - rwA + 1))
If rwA = 1 Then Exit Do
rwB = .Cells(rwA - 1, 2).End(xlUp).Row
rwA = .Cells(rwA, 1).End(xlUp).Row
Loop
End With
End Sub