Archive of Mr Excel Message Board


Back to Controls in Excel archive index
Back to archive home

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?

Re: Check boxe

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


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.