check boxes


Posted by Laurie Updegrove on August 20, 2001 6:58 AM

I put check boxes in my spreadsheet and would like to know how to count them



Posted by Russell Hauf on August 20, 2001 8:26 AM

Try this:

Sub CountCheckBoxes()

Dim shp As Shape
Dim intI As Integer

For Each shp In ActiveSheet.Shapes

If shp.FormControlType = xlCheckBox Then

intI = intI + 1

End If

Next shp

Debug.Print intI ' This is your total # of checkboxes

End Sub

Hope this helps,

Russell