Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform. It is increasing in complexity with
various controls in it. It has: 1 Text Box 6 checkboxes 2 buttons Is there a way to count the number of check boxes the form has? I know that I can count the number of total controls by : NumberofControls = Userform1.Controls.Count This gives me a value of 9 which includes the text box and the two buttons. How do I isolate the checkboxes or any other control of my liking. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Off Google:
Try something like the following: Dim Ctrl As MSForms.Control Dim N As Long For Each Ctrl In UserForm1.Controls If TypeOf Ctrl Is MSForms.CheckBox Then N = N + 1 End If Next Ctrl -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "ExcelMonkey" wrote in message ... I have a userform. It is increasing in complexity with various controls in it. It has: 1 Text Box 6 checkboxes 2 buttons Is there a way to count the number of check boxes the form has? I know that I can count the number of total controls by : NumberofControls = Userform1.Controls.Count This gives me a value of 9 which includes the text box and the two buttons. How do I isolate the checkboxes or any other control of my liking. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform Checkboxes | Excel Discussion (Misc queries) | |||
Userform with Checkboxes | Excel Discussion (Misc queries) | |||
Userform CheckBoxes | Excel Programming | |||
Count CheckBoxes in UserForm | Excel Programming | |||
UserForm Checkboxes | Excel Programming |