" " c = c + 1 Loop For i = 1 To c N = N + Cells(5, i + 2) / (1 + Range("A5")) ^ i Next Ran" /> " " c = c + 1 Loop For i = 1 To c N = N + Cells(5, i + 2) / (1 + Range("A5")) ^ i Next Ran" /> " " c = c + 1 Loop For i = 1 To c N = N + Cells(5, i + 2) / (1 + Range("A5")) ^ i Next Ran"/>

VBA showing error : method 'default' of object 'range' failed

46 Views Asked by At
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.

0

There are 0 best solutions below