【发布时间】:2017-07-18 17:52:21
【问题描述】:
我正在尝试计算在用户表单的特定页面上选中的复选框的数量。我在 Excel 2010 中使用 VBA。
这是我的代码:
Public Sub AutoCount()
Dim ctl As control
Dim j As Long
For Each ctl In CharacterBuilder.MultiPage1.Pages(2).Controls' error occurs here
If TypeOf ctl Is msforms.CheckBox Then
If CharacterBuilder.Controls(ctl.name).Value = True Then
j = j + 1
End If
End If
Next
CharacterBuilder.Remaining.Caption = j
Unload CharacterBuilder.Skills 'Not sure what this does
End Sub
我收到运行时错误 459 对象或类不支持事件集。
【问题讨论】:
标签: excel vba checkbox userform multipage