Sub IfThenAnd()
Dim price As Single
Dim units As Integer
Dim rebate As Single
Const strMsg1 = "To get a rebate you must buy an additional "
Const strMsg2 = "Price must equal $7.00"
units = 234
price = 7
If price = 7 And units >= 50 Then
rebate = (price * units) * 0.1
MsgBox "The rebate is: $" & rebate
End If
If price = 7 And units < 50 Then
MsgBox strMsg1 & "50 - units."
End If
If price <> 7 And units >= 50 Then
MsgBox strMsg2
End If
If price <> 7 And units < 50 Then
MsgBox "You didn't meet the criteria."
End If
End Sub
|