Sub sec()
N = Range("B5")
c = 0
Do While Cells(5, c + 3) <> " "
c = c + 1
Loop
For i = 1 To c
N = N + Cells(5, i + 2) / (1 + Range("A5")) ^ i
Next
Range("G8") = N
End Sub
I was trying to find the NPV of a series of cashflow but the error message keeps popping up.