Re: counting checkboxes

Tech-Archive recommends: Fix windows errors by optimizing your registry



If you name your CheckBox'es so that they start with the same text ("CheckBox" for this example) and end in numbers of the same length (that is, use leading zeroes if there are more than 9 CheckBox'es; that is, the first 9 names should end with 01, 02, 03, etc. instead of just 1, 2, 3, etc.), then this code will count the number of with check marks in them...

Dim X As Long
Dim Count As Long
Dim C As Control
For Each C In Me.Controls
If C.Name Like "CheckBox##" Then
If C.Value = True Then Count = Count + 1
End If
Next

Rick


"Manny" <Manny@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:1B7FDDB6-6FE6-464C-9985-8E7735D7B515@xxxxxxxxxxxxxxxx
Is it possible to count up the "true" values of a series of checkboxes? If
so, what is the formula?
--
Thanks,
Manny

.


Quantcast