【发布时间】:2016-08-25 07:57:44
【问题描述】:
Private Sub ROLparameter_Click()
Line1: RolLow = InputBox("Please enter the lower bound percentage for ROL calculation between 0 and 100 (initially " & RolLow * 100 & "%):")
If Not 0 <= RolLow <= 100 Then GoTo Line1
End If
End Sub
我有用户表单按钮,当我按下它会进入这个子。问题是它给出了错误“如果没有如果则结束”。当我删除 end if 时,它的工作原理很奇怪。
如;
当用户输入 80 时,它确实将 RolLow 值识别为“80”。如果不将它定向到 end sub,如果我只使用“if”,那么它将一直定向到第 1 行。不检查值。
此代码在模块中正常工作。
可能是什么问题?
(变量在 subs 之前定义为 public)
(我也试过 module.variable 的东西)
【问题讨论】:
-
试试我下面回答中的代码