Private Sub Command1_Click()
Dim a As Object
For Each a In Me.Controls
If TypeName(a) = "OptionButton" Then
If a.Value = True Then
Select Case a.Name
Case "Option1"
MsgBox "123"
Case "Option2"
MsgBox "234"
Case "Option3"
MsgBox "abc"
End Select
End If
End If
Next
End Sub
Private Sub Command1_Click()
Dim i As Integer '循环计数变量
Dim Index As Integer '被选中的option的索引号
For i = 0 To Option1.Count - 1
If Option1(i).Value = True Then Index = i
Next
Select Case Index
Case 0
MsgBox "第一个"
Case 1
MsgBox "第二个"
Case 2
MsgBox "第三个"
End Select
End Sub