因此,這是代碼,它僅適用於整數我寫了一個VBA代碼輸入數據,但它並不適用於小數
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
它應該怎麼做?預期的行爲是什麼,這與你所觀察到的有何不同? – QHarr
使用逗號代替點 –
@QHarr我需要此代碼才能使用優惠券率= 5.25,但它僅適用於優惠券率= 5 –