mardi 30 octobre 2018

If Statement Ignored In Worksheet Change Byval Routine

Can anyone help me correct this code? I have it in the Worksheet_Change(ByVal Target As Range) but it only works for the if statement that evaluates the SalesPrice value of 317646. Even if i rearrange the if statement it won't execute the LoanAmount if statement.

If Target.Address = "$D$5" Then 'Sales Price
    If Range("LoanProgram").Value = "HFA Bond Miami FHA" And Range("LoanProgram").Value = "HFA Bond Miami Conv" Or Range("SalesPrice").Value > 317646 Then
        MsgBox "Max Sales Price is $317,646"
    End If

    If Range("LoanAmount").Value > 271050 & Sheets("Main").CheckBox1.Value = True Then
        MsgBox "Max Loan Amount is $271,050"
        Sheets("Main").CheckBox1.Value = False
    End If

    Call PushTo105Button
    Call Calc_MI
    Range("E6").Value = Range("D6").Value
End If

Aucun commentaire:

Enregistrer un commentaire