I am attempting to count the number of check boxes that have been checked on a specific page of a userform. I am using VBA with Excel 2010.
This is my code:
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
I get the run-time error 459 Object or Class Does not Support the set of events.