View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Loop for checkboxes

Hi Matt,

Something like this should work:

Private Sub CheckBox1_Click()
Dim ole As OLEObject

For Each ole In OLEObjects
If TypeOf ole.Object Is MSForms.CheckBox Then
If ole.Name < "CheckBox1" Then
ole.Visible = CheckBox1.Value
End If
End If
Next ole
End Sub

It loops through all OLEObjects, and if the current OLEObject in the loop is
a CheckBox, it will set its Visible property according to the value of
CheckBox1.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Matt wrote:
Control Checkboxes. Matt