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
答案 0 :(得分:1)
Please Use Comma ,
instead of dot .
答案 1 :(得分:0)
我也可以在输出中获得小数。你能否更具体一点。
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