Public WithEvents che As MSForms.CommandButton Public WithEvents frm As MSForms.UserForm Private Sub che_click() Dim index As Long With UserForm3.TextBox1 index = Val(Mid(che.Name, 14, 10)) '取出checkboxN中的数字N If index <> 12 Then If dd = True And index < 11 Then MsgBox "再次运算需要输入运算符号" Else mystr = mystr & frm.Controls("CommandButton" & index).Caption .Text = mystr dd = False End If End If End With End Sub 兰版,上面这段代码中 mystr = mystr & frm.Controls("CommandButton" & index).Caption 这一句,我改成了这样子,但是没有成功,是不是不支持这种写法呢? mystr = mystr & frm.che.Caption 我看che和frm都是声明过的啊。 |