Reputation: 31
So this is the code, which works only for integers
Dim CoupRate As Double
Do
CoupRate = InputBox("enter coupon rate in percent without % sign. It must be between 0.00% and 25.00%")
If CoupRate < 0 Or CoupRate > 25 Then
MsgBox ("CoupRate must be between 0% and 25%")
Else
Exit Do
End If
Loop
Upvotes: 0
Views: 94
Reputation: 458
I was able to get the decimals in the output as well. Could you please be more specific.
CoupRate = InputBox("enter coupon rate in percent without % sign. It must be between 0.00% and 25.00%")
If CoupRate < 0 Or CoupRate > 25 Then
MsgBox ("CoupRate must be between 0% and 25%")
Else
'Exit Do
MsgBox CoupRate & "%"
End If
Upvotes: 0