Hi guys,
I am trying to diable an option button, dependant on a user selection.
I have my modules as follows:
ThisWorkbook:
Standard:
and EventsTrapper class module:
I cant get the optSeaH to be disbaled when OptSum is true.
Any ideas?
Thanks in advance.
I am trying to diable an option button, dependant on a user selection.
I have my modules as follows:
ThisWorkbook:
Code:
Private Sub Workbook_Open()
Dim ctrl As MSForms.Control
Set col = New Collection
' This loop connects all buttons in UserForm
' to one event hanlder in EventsTrapper class.
For Each ctrl In frmTest.Controls
If TypeOf ctrl Is MSForms.OptionButton Then
Set EventTrapper = New EventsTrapper
Set EventTrapper.Button = ctrl
Set EventTrapper.Form = frmTest
col.Add EventTrapper
Set EventTrapper = Nothing
End If
Next
End Sub
Standard:
Code:
Public col As Collection
Public EventTrapper As EventsTrapper
and EventsTrapper class module:
Code:
Public WithEvents Button As MSForms.OptionButton
Public Form As MSForms.UserForm
Private Sub Button_Change()
With frmTest
If .OptSum.Value = True Then
.optSeaH.Enabled = False
End If
End With
End Sub
I cant get the optSeaH to be disbaled when OptSum is true.
Any ideas?
Thanks in advance.