How do I total a series of checked boxes?

D

dayoungblood

I have a line of activex checkmark control boxes. How do I total the number
of boxes that are checked?
 
R

Ron de Bruin

Hi dayoungblood

Try this

Sub test2()
Dim i As Long
i = 0
For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MSForms.CheckBox Then
If obj.Object.Value = True Then i = i + 1
End If
Next
MsgBox i
End Sub
 
R

Ron de Bruin

Oops you posted in functions

Or use a linked cell in the properties of each checkbox
And count the Tru's

=COUNTIF(A40:Z40,"True")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top