Assessing whether any checkboxes are checked within frame

G

Guest

Is it possible to check and see if at least 1 checkbox in a frame is checked.
I am assuming that you have to group the checkboxes and check on of their
properties within a For Each loop

Thanks.
 
T

Tom Ogilvy

Dim bChecked as Boolean
Dim ctl as Control

bChecked = False
for each ctl in Userform1.Frame1.Controls
if typeof ctl is MSForms.CheckBox then
if ctl.Value then
bChecked = True
exit for
end if
end if
Next
if bChecked = False then

msgbox "Please check on box"
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top