Praxistipps | Standardprozeduren | Microsoft-Text | Beispiele | Elemente |
Private Sub CommandButton1_Click() Dim ctr As Control Dim bln As Boolean For Each ctr In Controls If TypeName(ctr) = "OptionButton" Then If ctr Then bln = True Exit For End If End If Next ctr If bln Then MsgBox "Ausgewälte Option: " & ctr.Caption Else MsgBox "Es wurde kein Optionsfeld ausgewählt!" End If End Sub
Private Sub CommandButton1_Click() Dim iOpt As Integer For iOpt = 1 To 3 Controls("OptionButton" & iOpt).Caption = Cells(iOpt, 1).Value Next iOpt End Sub
Die Beispiele zum Einsatz von OptionButtons
![]() |
![]() |
![]() |