Private Sub CommandButton1_Click()
Dim c, buf As String
For Each c In Controls
If Left(c.Name, 8) = "CheckBox" Then
If c.Value Then buf = buf & c.Caption & vbCrLf
End If
Next c
MsgBox buf & "がオンです"
End Sub
Private Sub CommandButton1_Click()
Dim c, buf As String
For Each c In Controls
If TypeName(c) = "CheckBox" Then
If c.Value Then buf = buf & c.Caption & vbCrLf
End If
Next c
MsgBox buf & "がオンです"
End Sub