
'应该是这意思的吧
Option Explicit
Sub abc()
Dim a, i, sum
a = [a1].CurrentRegion.Offset(1).Resize(, 3).Value
For i = 1 To UBound(a) - 1
sum = sum + a(i, 2)
Next
For i = 1 To UBound(a) - 1
sum = sum - a(i, 3)
If sum < 0 Then Exit For
Next
[d:d].ClearContents
If i < UBound(a) Then Cells(i + 1, "d") = a(i, 1)
End Sub