Private Sub CommandButton1_Click()
Dim c As Control
For Each c In Me.Controls
If TypeName(c) Like "OptionButton*" Then
If c.Value = True Then
MsgBox "ok"
Exit Sub
End If
End If
Next c
MsgBox "pas ok"
End Sub
Private Sub CommandButton1_Click()
Dim c As Control
For Each c In Me.Controls
If TypeName(c) = "OptionButton" Then
If c Then MsgBox "Ok": Exit Sub
End If
Next
MsgBox "Pas ok"
End Sub
Private Sub CommandButton1_Click()
Dim c As Control, mess As String
mess = "pas OK"
For Each c In Me.Controls
If TypeOf c Is MSForms.OptionButton Then
If c Then mess = "OK": Exit For
End If
Next
MsgBox mess
End Sub
Private Sub CommandButton1_Click()
MsgBox IIf(Application.Max(OptionButton1, OptionButton2, OptionButton3, OptionButton4) > 0, "OK", "pas OK")
End Sub
Hello tout le monde,
Dans un Usf avec des OptionButton, comment lui dire que :
Si au moins un des contrôles est actif = Blabli
si non = Blabla
J'ai beau tester des boucles, rien à faire je ne trouve pas
Merci à tous de me lire.
Private Sub CommandButton1_Click()
MsgBox IIf(O1 + O2 + O3 + O4 = 0, "KO", "OK")
End Sub
il peut se trouver quelques lignes ailleurs qui mettent les options à False !