View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Corey Corey is offline
external usenet poster
 
Posts: 363
Default Togglebutton to change Checkboxes

I also tried the :
If togglebutton1=true then
and the
If togglebutton1.value = True

to no avail....



"Corey" wrote in message ...
I am trying to get a toggle button when pressed to tick ALL checkboxes(17) on a form, but cannot get
it to change them.

I am using:

Private Sub ToggleButton1_Click()
If ToggleButton1 Then
CheckBox1 = True And CheckBox2 = True And CheckBox3 = True And CheckBox4 = True And CheckBox5 = True
And CheckBox6 = True And _
CheckBox7 = True And CheckBox8 = True And CheckBox9 = True And CheckBox10 = True And CheckBox11 =
True And CheckBox12 = True And _
CheckBox13 = True And CheckBox14 = True And CheckBox15 = True And CheckBox16 = True And CheckBox17
= True
Else
CheckBox1 = False And CheckBox2 = False And CheckBox3 = False And CheckBox4 = False And CheckBox5 =
False And CheckBox6 = False And _
CheckBox7 = False And CheckBox8 = False And CheckBox9 = False And CheckBox10 = False And CheckBox11
= False And CheckBox12 = False And _
CheckBox13 = False And CheckBox14 = False And CheckBox15 = False And CheckBox16 = False And
CheckBox17 = False
End If
End Sub


WHY does it not work?

Corey....