Check boxe


Posted by GHatch on January 02, 2002 12:00 PM

I have a worksheet that uses checkboxes and I would like to sum the boxes that are check vs the ones that are not checked. How do I do that? What function or formula do I use?



Posted by Jacob on January 03, 2002 12:18 AM

Hi

Sub CountEm
Dim Counter as integer
on error resume next

for x = 1 to userform1.controls.count
if userform(x).control = TRUE Then
Counter = Counter + 1
else
end if
next x
end sub

This assumes that there are no other controls that have true/false otherwise you can list each checkbox seperately and check for true/false.

HTH
Jacob