Function RealActiveControl() as Object
Set RealActiveControl = Userform1.ActiveControl
Do While True
Select Case TypeName(RealActiveControl)
Case "Frame"
Set RealActiveControl = RealActiveControl.ActiveControl
Case "MultiPage"
With RealActiveControl
Set RealActiveControl = .Pages(.Value).ActiveControl
End With
Case Else
Exit Function
End Select
Loop
End Function
Sheets("Sheet1").Range("a1") = UserForm1.optionbutton1.Caption
Private Sub OptionButton1_Click()
Macro1 OptionButton1.Caption
End Sub
Private Sub OptionButton2_Click()
Macro1 OptionButton2.Caption
End Sub
Sub Macro1(strCapt As String)
Sheets("Sheet1").Range("A1") = strCapt
End Sub