I think the Frame event will only fire if the non-OB part of the frame is clicked
The usual way is to define a clsOptionButton class
Option Explicit
Public WithEvents ctlOptionButton As MSForms.OptionButton
Private Sub ctlOptionButton_Change()
If ctlOptionButton.Value Then
MsgBox ctlOptionButton.Name & " is selected"
End If
End Sub
and hook the OB controls to the class, in an array or collection
Option Explicit
Dim aOptionButtons() As clsOptionButton
Private Sub CommandButton1_Click()
Me.Hide
Unload Me
End Sub
Private Sub Frame1_Click()
Dim I as long
MsgBox Me.Frame1.Caption
For i = 0 To Me.Frame1.Controls.Count - 1
MsgBox Me.Frame1.Controls(i).Name
Next I
End Sub
Private Sub UserForm_Initialize()
Dim oControl As Object, iCounter As Long
Me.OptionButton1.Value = True
ReDim aOptionButtons(1 To Me.Controls.Count)
For Each oControl In Me.Controls
If TypeName(oControl) = "OptionButton" Then
iCounter = iCounter + 1
Set aOptionButtons(iCounter) = New clsOptionButton
Set aOptionButtons(iCounter).ctlOptionButton = oControl
End If
Next
ReDim Preserve aOptionButtons(1 To iCounter)
End Sub
OB's are little tricky, since there are actually 2 change events that fire, the one that was True --> False and the one that was False --> True
Also, the controls in a Frame are accessable using the Frame.Controls, so if there is more than one Frame, you'll have to do some additional work
Sample WB