Hello there,

I want to get all checked checkbox on the form.
I always wasting my time to checking it one by one.
There is a way to do this?

Best regards
vixion

Recommended Answers

All 3 Replies

This should working :

Private Sub Command1_Click()
For Each ctl In Me.Controls
    If TypeOf ctl Is CheckBox Then
        If ctl.Value = vbChecked Then
            MsgBox ctl.Name
        End If
    End If
Next
End Sub
commented: never think about this in my program. very useful function and svae my times. +0

What a piece of code.
Thank you very much for the help sir.

Vixion

how do i add the of total the values in the checkbox.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.