Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub commandbutton1_click()
Dim r As Control Dim w As String w = "" For Each r In UserForm2.Controls If TypeOf r Is msforms.CheckBox Then If r.Value Then w = w & r.Caption & vbCr End If End If Next msgbox w End Sub Tested in xl97 -- Regards, Tom Ogilvy Steven Cheng wrote in message ... I have a userform that has several (30) checkboxes and want to test which ones have been selected by showing the checkbox names through a messagebox. I started my code off like this once the commandbutton on the userform has been selected: private sub commandbutton1_click() dim r as checkbox dim w as string w = "" for each r in userform1 if r.value then w = w & r.caption & vbcr end if next end sub But it appears that I am not getting the right object/collection combination. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checkboxes | Excel Discussion (Misc queries) | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
Using Checkboxes | Excel Discussion (Misc queries) | |||
checkboxes | Excel Worksheet Functions | |||
Checkboxes | Excel Discussion (Misc queries) |