Groups of controls
You can test a group like this
Dim ctl As Object
Dim i As Long
Application.EnableEvents = False
On Error Resume Next
For Each ctl In ActiveSheet.OLEObjects
If ctl.Object.GroupName = "xxx" Then
If Err.Number = 0 Then
Range(ctl.LinkedCell).Value = False
End If
End If
Next ctl
On Error GoTo 0
Application.EnableEvents = True
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
"FB" wrote in message
ups.com...
These are ActiveX controls. They are linked to cells. When a control is
clicked, I would like the values of the cells linked to the controls in
the other groups to turn to 'False'. For now, I use stuff like
Private Sub CbxChina_Click()
If Range("AA7").FormulaR1C1 = "TRUE" Then
Range("AA5").FormulaR1C1 = "TRUE"
Range("AA4").FormulaR1C1 = "FALSE"
Range("AA6").FormulaR1C1 = "FALSE"
Range("AA15:AA22").FormulaR1C1 = "FALSE"
Range("AB4:AB29").FormulaR1C1 = "FALSE"
End If
End Sub
for individual controls, but as I have about 50 controls on my sheet, I
cannot do this systematically!
Franck
|