Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why Checkbox count = 4
How did you declare ckboxct?
Is it accumulating each time you run the procedure? JMay wrote: attempting to better understand the use of TypeOf I have created: All message boxs return the proper number, except the CkBoxct, which returns 4, when IN FACT there is only 1 Checkbox on my Userform1. Any ideas why this problem? TIA, Jim May Private Sub CommandButton1_Click() For Each ctl In UserForm1.Controls If TypeOf ctl Is MSForms.Label Then labelct = labelct + 1 If TypeOf ctl Is MSForms.Frame Then Framect = Framect + 1 If TypeOf ctl Is MSForms.CheckBox Then CkBoxct = CkBoxct + 1 If TypeOf ctl Is MSForms.TextBox Then Txtct = Txtct + 1 If TypeOf ctl Is MSForms.OptionButton Then OptBnct = OptBnct + 1 If TypeOf ctl Is MSForms.ComboBox Then ComBoxct = ComBoxct + 1 Next ctl MsgBox "labels total " & labelct MsgBox "Frame total " & Framect MsgBox "Checkboxes total " & CkBoxct MsgBox "Textboxs total " & Txtct MsgBox "OptionButtons total " & OptBnct MsgBox "ComboBoxs total " & ComBoxct End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to have Checkbox A uncheck with checked Checkbox B | Excel Discussion (Misc queries) | |||
Why Checkbox count = 4 | Excel Programming | |||
link a checkbox in a sheet to a checkbox on a userform? | Excel Programming | |||
How do I link one checkbox to update another checkbox? | Excel Programming | |||
checkbox on form reset from checkbox on sheet | Excel Programming |