【发布时间】:2017-08-02 02:20:17
【问题描述】:
我正在努力建立价值
If UserForm1.p1OptionButton.Value = True
p1OptionButton 中的 1 是 For Next 循环计数器的值,但我遇到了错误,但我尝试构建它。如果我使用
Dim iPart As Integer
For iPart = 1 to 6
If "UserForm1.p" & iPart & "OptionButton.Value" = True
.... blah blah blah rest of the code
Next iPart
我收到此错误:
运行时错误 13 类型不匹配。
如果我将 " 从字符串的其他部分排除在外,它也不起作用。
感谢您的帮助。
【问题讨论】:
标签: vba excel for-loop userform