Check Boxes

G

Guest

I have a Series of Check Boxes (the ActiveX Control) inserted onto an Excel
Spreadsheet. I have another Check Box that I want to use as most are used,
when it gets checked, all the checkboxes will show themselves as checked.
The only way i can figure to do this is to loop through all the check boxes,
one by one and change its state to checked. The way I want to see it done is
whenever the Main checkbox is checked i want all the other checkboxes to
change state to checked simultaneously....not one at a time when looping. Is
there a way this can be done or am I stuck with the loop? Any thoughts or
suggestions would be greatly appreciated.
 
B

Bob Phillips

A loop I am afraid, but automatic.

This assumes the master checkbox is called chkMaster

Private Sub chkMaster_Click()
Dim mpOLEObject As Object
With Me
For Each mpOLEObject In .OLEObjects
If TypeName(mpOLEObject.Object) = "CheckBox" Then
If mpOLEObject.Name <> "chkMaster" Then
mpOLEObject.Object.Value =
Me.OLEObjects("chkMaster").Object.Value
End If
End If
Next mpOLEObject
End With
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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