Paste this function into a module,
-----------------------------
-------------------------
Function Count_to_x(InRange, criteria)
Dim total As Long
Set SubSetRange1 = _
Intersect(InRange.Parent.UsedRange, InRange)
For Each cell In SubSetRange1
total = total + cell.Value
If total >= criteria Then Count_to_x = total: total = 0 Else Count_to_x = total
Next cell
End Function
------------------------
then in the spreadsheet....if data is in col A
paste this formula in b1...
=count_to_x($A$1:A1,$F$1)
note: that the criteria or max to count is in cell f1 and the first cell in the range ($a$1) and the criteria ($f$1) are ranged absolute.
fill down