Community discussion forum

Macro in Excel, and If statement that needs to loop through a range

  • 5 months ago

    Hi guys

    I know that it is such a simple step I am missing in this code.

    It is a macro for excel

    Sub Marco()
    
    Dim Interest 
    
                Interest = worksheets(“Calc”).Range(“J2”)
    
    
    
    Do
    
                If Interest < 0 Then
    
                            worksheets(“Pram”).Range(“B12”) = worksheets(“Calc”).Range(“A2”)
    
                Else
    
                            worksheets(“Pram”).Range(“B12”) =[ “No Problem”]
    
                End If
    
                Loop until Interest < 0
    
    End Sub
    

    I need the loop to keep running until the interest is Less than 0 The cell Ref worksheets(“Calc”).Range(“J2”) needs to increase to worksheets(“Calc”).Range(“J3”) And worksheets(“Calc”).Range(“A2”) needs to increase to worksheets(“Calc”).Range(“A3”)

    And so until the result is less than Zero

    thanks

    Post was edited on 19/06/2009 10:03:39 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!