Thread: Checkboxes
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Checkboxes

Put this code behind the commandbutton

Private Sub CommandButton1_Click()
If Not Me.CheckBox1.Value And _
Not Me.CheckBox2.Value And _
Not Me.CheckBox3.Value And _
Not Me.CheckBox4.Value And _
Not Me.CheckBox5.Value Then
MsgBox "Nothing selected, try again"
Else
'do your stuff
End If
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Tammy H" wrote in message
...
I have a worksheet that has 5 checkboxes. I used the Contol Toolbox to

place
these in the worksheet. How can I make sure the user checks at least one

of
the 5 checkboxes? I would like to add the code to a command button that

the
user will click when they send the form.