VBA 问题 #6 tr 值溢出

问题描述 投票:0回答:0

这是我的代码,每次我在输入框“.2”中输入税率时,都会收到溢出错误,但我不明白为什么。

Sub bookNetPay()
    Dim en As String
    Dim tr As Single
 
    en = InputBox("What is the employee's name?")
    tr = InputBox("What is the tax rate?")
    
End Sub

我尝试输入错误描述,更改我放入框中的值,将“CDbl”放在 InputBox 前面,但这并没有解决我的任何问题。我每次都会收到溢出错误。我正在关注我老师制作的视频,他的代码有效,所以我似乎看不出我的代码和他的代码有什么区别。

excel vba overflow inputbox
© www.soinside.com 2019 - 2024. All rights reserved.