View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RyanH RyanH is offline
external usenet poster
 
Posts: 586
Default Make Enable Property = OptionButton.Value for all Controls in Fram

I have an optionbutton in a frame along with a variety of controls. I would
like to enable = True when the Option Button = True and visa versa. The code
below works, but only for TextBoxes. Can this code work for all controls?

Private Sub OptionButton13_Click()

Dim ctrl As Control

For Each ctrl In Me.Frame2.controls
If TypeOf ctrl Is MsForms.TextBox Then
ctrl.Enabled = OptionButton13.Value
End If
Next

End Sub

Thanks,
Ryan