ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I total a series of checked boxes? (https://www.excelbanter.com/excel-worksheet-functions/99540-how-do-i-total-series-checked-boxes.html)

dayoungblood

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

Ron de Bruin

How do I total a series of checked boxes?
 
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


--
Regards Ron de Bruin
http://www.rondebruin.nl



"dayoungblood" wrote in message ...
I have a line of activex checkmark control boxes. How do I total the number
of boxes that are checked?




Ron de Bruin

How do I total a series of checked boxes?
 
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")



--
Regards Ron de Bruin
http://www.rondebruin.nl



"dayoungblood" wrote in message ...
I have a line of activex checkmark control boxes. How do I total the number
of boxes that are checked?





All times are GMT +1. The time now is 12:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com