View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mauro Gamberini[_3_] Mauro Gamberini[_3_] is offline
external usenet poster
 
Posts: 12
Default Control checkboxes

Try:

Private Sub CheckBox1_Click()

Dim s As String
Dim c As Control
Dim lng As Long

For lng = 2 To 5

s = "CheckBox" & lng
If Me.CheckBox1.Value = True Then
Me.Controls(s).Enabled = True
Else
Me.Controls(s).Enabled = False
End If
Next

End Sub


Private Sub UserForm_Initialize()

Dim c As Control
Dim lng As Long
Dim s As String

For lng = 2 To 5
s = "CheckBox" & lng
Me.Controls(s).Enabled = False
Next

End Sub

--
---------------------------
Mauro Gamberini
http://www.riolab.org/
"Newbeetle" ha scritto nel messaggio
...
Hi I have five check boxes from the control menu, these are named
Checkbox1
through to 5.

When checkbox1 is unchecked I would like checkbox2 through to 5 to become
unchecked and grayed out.

When checkbox1 is ticked I would like checkbox2 through to 5 to become
active so that I can check them as required.

Hope that makes sense

Regards

Newbeetle


--
This post was created using recycled electrons!