Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi All, I've got a few CheckBoxes in a UserForm. How can I count the CheckBoxes in VBA?? Please help:) Lenny -- Lenny_821 ------------------------------------------------------------------------ Lenny_821's Profile: http://www.excelforum.com/member.php...o&userid=15179 View this thread: http://www.excelforum.com/showthread...hreadid=319438 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Lenny,
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 "Lenny_821" wrote in message ... Hi All, I've got a few CheckBoxes in a UserForm. How can I count the CheckBoxes in VBA?? Please help:) Lenny -- Lenny_821 ------------------------------------------------------------------------ Lenny_821's Profile: http://www.excelforum.com/member.php...o&userid=15179 View this thread: http://www.excelforum.com/showthread...hreadid=319438 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim ctrl as MsForms.Control, cnt as Long
cnt = 0 for each ctrl in Userform1.Controls if typeof ctrl is msforms.checkbox then cnt = cnt + 1 end if Next msgbox cnt -- Regards, Tom Ogilvy "Lenny_821" wrote in message ... Hi All, I've got a few CheckBoxes in a UserForm. How can I count the CheckBoxes in VBA?? Please help:) Lenny -- Lenny_821 ------------------------------------------------------------------------ Lenny_821's Profile: http://www.excelforum.com/member.php...o&userid=15179 View this thread: http://www.excelforum.com/showthread...hreadid=319438 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Works great, just what I was looking for:):) Thanks Lenny Tom Ogilvy Wrote: Dim ctrl as MsForms.Control, cnt as Long cnt = 0 for each ctrl in Userform1.Controls if typeof ctrl is msforms.checkbox then cnt = cnt + 1 end if Next msgbox cnt -- Regards, Tom Ogilvy "Lenny_821" wrote in message ... Hi All, I've got a few CheckBoxes in a UserForm. How can I count the CheckBoxes in VBA?? Please help:) Lenny -- Lenny_821 ------------------------------------------------------------------------ Lenny_821's Profile: http://www.excelforum.com/member.php...o&userid=15179 View this thread: http://www.excelforum.com/showthread...hreadid=319438 -- Lenny_821 ------------------------------------------------------------------------ Lenny_821's Profile: http://www.excelforum.com/member.php...o&userid=15179 View this thread: http://www.excelforum.com/showthread...hreadid=319438 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform Checkboxes | Excel Discussion (Misc queries) | |||
Userform with Checkboxes | Excel Discussion (Misc queries) | |||
Can't check checkboxes in userform ... sometimes | Excel Programming | |||
UserForm Checkboxes | Excel Programming | |||
add multiple checkboxes to userform at runtime | Excel Programming |