affichage UserForm

ARNAUD ZIRIPE

XLDnaute Occasionnel
bonsoir à tous
Voila j'ai un tout petit probleme et je souhaiterais avoir de l'aide.
En faite j'ai un Uf qui me permet d'afficher deux uf en fonction du choix fait dans une combobox.
Le deuxième s'affiche mais le première pas du tout.
voici le code:

Private Sub CommandButton1_Click()
If ComboBox1.Value = "BAC A" Then
Unload Me
Load UserForm4
UserForm4.Show
Else
If ComboBox1.Value = "BAC D" Then
Unload Me
Load UserForm8
UserForm8.Show
End If
End If
End Sub
 

juju_69

XLDnaute Occasionnel
Re : affichage UserForm

Bonjour,

Je pense que tu peux déjà simplifier ton code et inverser si la 2ème est ok :

Code:
Private Sub CommandButton1_Click()
If ComboBox1.Value = "BAC D" Then
Unload Me
UserForm8.Show
Else
Unload Me
UserForm4.Show
End If
End Sub

Comme cela ça donne quoi ?
 

Discussions similaires

Réponses
6
Affichages
273
Réponses
6
Affichages
303

Statistiques des forums

Discussions
312 587
Messages
2 090 009
Membres
104 344
dernier inscrit
nesrine