Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
J-Dan
bonjour Sten,
essaie cette macro :
Private Sub testOptionButtons() For Each ctrl In Me.Controls If TypeName(ctrl) = "OptionButton" Then If ctrl = True Then Exit Sub End If End If Next
MsgBox "you must choose an option !" End Sub
bon courage
-----Message d'origine----- Bonjour a toutes et a tous! Dans un usf j'ai 24 boutons d'options comment faire pour afficher un msgbox si aucun n'est sélectionné? Merci .
bonjour Sten,
essaie cette macro :
Private Sub testOptionButtons()
For Each ctrl In Me.Controls
If TypeName(ctrl) = "OptionButton" Then
If ctrl = True Then
Exit Sub
End If
End If
Next
MsgBox "you must choose an option !"
End Sub
bon courage
-----Message d'origine-----
Bonjour a toutes et a tous!
Dans un usf j'ai 24 boutons d'options comment faire pour
afficher un msgbox si aucun n'est sélectionné?
Merci
.
Private Sub testOptionButtons() For Each ctrl In Me.Controls If TypeName(ctrl) = "OptionButton" Then If ctrl = True Then Exit Sub End If End If Next
MsgBox "you must choose an option !" End Sub
bon courage
-----Message d'origine----- Bonjour a toutes et a tous! Dans un usf j'ai 24 boutons d'options comment faire pour afficher un msgbox si aucun n'est sélectionné? Merci .
Michel Gaboly
Bonjour,
Dans le UserForm_Initialize, associe une chaîne vide à une variable, "Choix" par exemple.
Lors dun clic sur un OptionButton, modifie la valeur de Choix, en lui donnant par exemple comme valeur la propriété Caption de l'OptionButton.
Il suffit alors de tester si Choix est toujours égal à "", pour déter- miner s'il faut afficher un MsgBox.
Tu peux utiliser un module de classe pour éviter de devoir écrire 24 procédures correspondant chacune à un clic sur un OptionButton.
Bonjour a toutes et a tous! Dans un usf j'ai 24 boutons d'options comment faire pour afficher un msgbox si aucun n'est sélectionné? Merci
-- Cordialement,
Michel Gaboly http://www.gaboly.com
Bonjour,
Dans le UserForm_Initialize, associe une chaîne vide à
une variable, "Choix" par exemple.
Lors dun clic sur un OptionButton, modifie la valeur de Choix,
en lui donnant par exemple comme valeur la propriété Caption
de l'OptionButton.
Il suffit alors de tester si Choix est toujours égal à "", pour déter-
miner s'il faut afficher un MsgBox.
Tu peux utiliser un module de classe pour éviter de devoir écrire
24 procédures correspondant chacune à un clic sur un OptionButton.
Bonjour a toutes et a tous!
Dans un usf j'ai 24 boutons d'options comment faire pour
afficher un msgbox si aucun n'est sélectionné?
Merci