Checkbox behaving strangely
Private Sub CheckBox61_Click()
dim i as long ' index
for i= 41 to 60
controls("checkbox" & i).Value = checkbox61.Value
Next
End Sub
Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
I have a strange problem with the following code:
'When Checkbox 61 is true, all checkboxes are true
'Checkbox 61 is Select All of Cycle_Type Table
Private Sub CheckBox61_Click()
If CheckBox61.Value = True Then
CheckBox41.Value = True
CheckBox42.Value = True
CheckBox43.Value = True
CheckBox44.Value = True
CheckBox45.Value = True
CheckBox46.Value = True
CheckBox47.Value = True
CheckBox48.Value = True
CheckBox49.Value = True
CheckBox50.Value = True
CheckBox51.Value = True
CheckBox52.Value = True
CheckBox53.Value = True
CheckBox54.Value = True
CheckBox55.Value = True
CheckBox56.Value = True
CheckBox57.Value = True
CheckBox58.Value = True
CheckBox59.Value = True
CheckBox60.Value = True
Else
CheckBox41.Value = False
CheckBox42.Value = False
CheckBox43.Value = False
CheckBox44.Value = False
CheckBox45.Value = False
CheckBox46.Value = False
CheckBox47.Value = False
CheckBox48.Value = False
CheckBox49.Value = False
CheckBox50.Value = False
CheckBox51.Value = False
CheckBox52.Value = False
CheckBox53.Value = False
CheckBox54.Value = False
CheckBox55.Value = False
CheckBox56.Value = False
CheckBox57.Value = False
CheckBox58.Value = False
CheckBox59.Value = False
CheckBox60.Value = False
End If
End Sub
Wehn I select CheckBox61, all but Checkbox41 and
Checkbox61 are selected. No matter how many times I click
on CheckBox61, it does not get selected UNTIL I
seperately select CheckBox41. Then I am able to select
CheckBox61. Now if de-select CheckBox61, all the
checkboxes are cleared.
Why is this happening? I have done the same things
thrice before, but there its working fine. Please help.
TIH
Shilps
.
|