I forgot to reset Startrow
[vba]
Public Sub ProcessData()
Dim Startrow As Long
Dim Lastrow As Long
Dim i As Long
Application.ScreenUpdating = False
With ActiveSheet
Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
Startrow = 1
For i = 1 To Lastrow + 1
If .Cells(i, "A").Value2 = "" Then
.Cells(i, "B").Formula = "=SUM(B" & Startrow & ":B" & i - 1 & ")"
Startrow = i +1
End If
Next i
End With
Application.ScreenUpdating = True
End Sub
[/vba]
BTW, are tyhe column A values really repeating or is that just illustrative?