I have three option buttons and there will be about 10 later. Trying to set public option button like that
Code: Select all
Private a, vOpt As MSForms.OptionButton
Private Sub Label9_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If Not vOpt Is Nothing Then
MsgBox vOpt.Name
Else
MsgBox "Option Button Not Selected."
End If
End Sub
Private Sub UserForm_Initialize()
If optName.Value = True Then
Set vOpt = optName
ElseIf optCode.Value = True Then
Set vOpt = optCode
ElseIf optID.Value = True Then
Set vOpt = optID
End If
End Sub